Releases: cap-js/graphql
Releases · cap-js/graphql
v0.6.1
Changed
- Improved query logging:
- Don't log queries that are
undefined - Log
operationName - Log
variableswhen not in production - Sanitize arguments and their values in queries when in production
- Don't log queries that are
Fixed
- Changed GraphiQL Explorer Plugin CDN URL due to upstream renaming
v0.6.0
Added
- Support for
@sap/cds^7middlewares and protocols. Note: services now need to be annotated with protocol annotations such as@graphqlor@protocol: 'graphql'.
Changed
- Bump required
@sap/cdsversion to>=7 @cap-js/graphql/index.jsnow collects individual services and mounts the adapter as a protocol middleware on thecds.on('served', ...)event- Moved the
GraphQLAdaptermodule tolib/GraphQLAdapter.jsand merged it withCDSGraphQLAdapterpreviously found inindex.jsin the root directory - Don't generate fields that represent compositions of aspects within mutation types that represent services
- Disabled conjunction on the same field for the following operators:
eq(Equal)gt(Greater Than)ge(Greater Than or Equal)le(Less Than or Equal)lt(Less Than)startswithendswith
v0.5.0
Changed
- Improved consistency of handling results of different types returned by custom handlers in CRUD resolvers:
- Wrap only objects (i.e. not primitive types or arrays) returned by custom handlers in arrays in create, read, and update resolvers
- Delete mutations return the length of an array that is returned by a
DELETEcustom handler or 1 if a single object is returned
- Don't generate fields for key elements in update input objects
- Update and delete mutations have mandatory
filterargument - Allow services that are not instances of
cds.ApplicationService. It is expected that the invoker provides the correct set of service providers when directly using the GraphQL protocol adapter API.
Fixed
- Aligned
cds.Requestinstantiation with other protocols for more consistent usage in custom handlers
v0.4.1
Fixed
cds-plugin.jswas missing infilesproperty ofpackage.json
v0.4.0
Added
- Supporting new
cds-plugintechnique for zero configuration - Support for filtering by
nullvalues - Allow multiple filters on the same field, with the same operator, that are logically joined by
AND. For example, filtering for all books with titles that contain both strings, "Wuthering" and "Heights":{ AdminService { Books(filter: { title: { contains: ["Wuthering", "Heights"] } }) { nodes { title } } } }
Changed
- Improved handling of
nullandundefinedvalues in query arguments - Empty filter lists resolve to
falseand empty filter objects resolve totrue
Fixed
- Handling of GraphQL queries that are sent via
GETrequests using thequeryURL parameter if GraphiQL is enabled
v0.3.1
Fixed
- Add
appfolder tofilesproperty ofpackage.jsonto be included for publishing tonpm
v0.3.0
Changed
- Replaced deprecated GraphQL HTTP server
express-graphqlwithgraphql-http - Serve GraphiQL 2 via included HTML instead of relying on the server framework (
express-graphqlincluded GraphiQL 1) - Bump
graphqlversion to 16 - Execute query resolvers in parallel and mutation resolvers serially
v0.2.0
Changed
- Register
aliasFieldResolverduring schema generation instead of passing it to the GraphQL server - The filters
contains,startswith, andendswithnow generate CQN function calls instead of generatinglikeexpressions directly
Fixed
- Schema generation crash that occurred if an entity property is named
localized - The field
totalCountcould not be queried on its own
v0.1.0
Added
- To-many relationships are now represented by an additional nesting level which contains the fields
totalCountandnodes.totalCountis similar to OData$count.nodescontains the fields belonging to the entity. This is similar to the GraphQL cursor connection specification, but without an additional secondedgesnesting level. The following shows an example query using the new schema structure:{ AdminService { Books { totalCount nodes { title } } } } - Support for aliases on fields returned by mutations
- Improved support for aliases on fields that represent compositions and associations (some limitations still apply)
- Include localized
textsfields of entities in schema generation - Improve check to skip field
localizedduring schema generation
Changed
- The GraphQL protocol adapter now uses a new middlewares mechanism instead of
cds.pluginswhich requires@sap/cdsversion 6.3 to run. Enable thecds.requires.middlewaresflag and register the GraphQL protocol adapter incds.env.protocolsto get started. - Replaced
debuglevel query and mutation logging with improvedinfolevel request logging