Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ Delete mutations return the length of an array that is returned by a `DELETE` custom 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 `filter` argument
- 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 adpater API.

### Fixed

Expand Down
3 changes: 0 additions & 3 deletions lib/resolvers/root.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const cds = require('@sap/cds/lib')
const { gqlName } = require('../utils')
const resolveQuery = require('./query')
const resolveMutation = require('./mutation')
Expand Down Expand Up @@ -50,8 +49,6 @@ module.exports = services => {

for (const key in services) {
const service = services[key]
if (!(service instanceof cds.ApplicationService)) continue

const gqlServiceName = gqlName(service.name)
Query[gqlServiceName] = _wrapResolver(service, resolveQuery, true)
Mutation[gqlServiceName] = _wrapResolver(service, resolveMutation, false)
Expand Down
3 changes: 0 additions & 3 deletions lib/schema/mutation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const cds = require('@sap/cds/lib')
const { GraphQLObjectType, GraphQLList, GraphQLInt, GraphQLNonNull } = require('graphql')
const { gqlName } = require('../utils')
const objectGenerator = require('./types/object')
Expand All @@ -12,8 +11,6 @@ module.exports = cache => {

for (const key in services) {
const service = services[key]
if (!(service instanceof cds.ApplicationService)) continue

const serviceName = gqlName(service.name)
const resolve = resolvers[serviceName]
const type = _serviceToObjectType(service)
Expand Down
3 changes: 0 additions & 3 deletions lib/schema/query.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const cds = require('@sap/cds/lib')
const { GraphQLObjectType } = require('graphql')
const { gqlName } = require('../utils')
const objectGenerator = require('./types/object')
Expand All @@ -10,8 +9,6 @@ module.exports = cache => {

for (const key in services) {
const service = services[key]
if (!(service instanceof cds.ApplicationService)) continue

const serviceName = gqlName(service.name)
const resolve = resolvers[serviceName]
fields[serviceName] = { type: _serviceToObjectType(service), resolve }
Expand Down