What you were expecting:
The README for react-data-graphql-simple documents a deletePost mutation with the signature:
deletePost(id: ID!): Boolean
I expect to be able to implement this mutation for my resources in my GraphQL schema, and have react-admin run it correctly.
What happened instead:
react-admin is querying for an id field on the deleteState (State is my resource), which throws a GraphQL error since deleteState is set to return a Boolean.

Steps to reproduce:
Other information:
Environment
- React-admin version: 2.2.3
Error Payload:
{
"errors": [
{
"message": "Field \"deleteState\" must not have a selection since type \"Boolean\" has no subfields.",
"locations": [{ "line": 2, "column": 30 }],
"extensions": {
"code": "GRAPHQL_VALIDATION_FAILED",
"exception": {
"stacktrace": [
"Field \"deleteState\" must not have a selection since type \"Boolean\" has no subfields.",
"",
"GraphQL request (2:30)",
"1: mutation deleteState($id: ID!) {",
"2: data: deleteState(id: $id) {",
" ^",
"3: id",
"",
" at Object.Field (/Users/kyle_pollich/Workspace/work/artifex-press/replatform/artifex-press-api/node_modules/graphql/validation/rules/ScalarLeafs.js:50:33)",
" at Object.enter (/Users/kyle_pollich/Workspace/work/artifex-press/replatform/artifex-press-api/node_modules/graphql/language/visitor.js:343:29)",
" at Object.enter (/Users/kyle_pollich/Workspace/work/artifex-press/replatform/artifex-press-api/node_modules/graphql/language/visitor.js:394:25)",
" at visit (/Users/kyle_pollich/Workspace/work/artifex-press/replatform/artifex-press-api/node_modules/graphql/language/visitor.js:261:26)",
" at Object.validate (/Users/kyle_pollich/Workspace/work/artifex-press/replatform/artifex-press-api/node_modules/graphql/validation/validate.js:63:22)",
" at Promise.resolve.then (/Users/kyle_pollich/Workspace/work/artifex-press/replatform/artifex-press-api/node_modules/apollo-server-core/src/runQuery.ts:188:30)",
" at <anonymous>",
" at process._tickCallback (internal/process/next_tick.js:188:7)"
]
}
}
}
]
}
What you were expecting:
The README for
react-data-graphql-simpledocuments adeletePostmutation with the signature:I expect to be able to implement this mutation for my resources in my GraphQL schema, and have
react-adminrun it correctly.What happened instead:
react-adminis querying for anidfield on thedeleteState(State is my resource), which throws a GraphQL error sincedeleteStateis set to return aBoolean.Steps to reproduce:
Other information:
Environment
Error Payload:
{ "errors": [ { "message": "Field \"deleteState\" must not have a selection since type \"Boolean\" has no subfields.", "locations": [{ "line": 2, "column": 30 }], "extensions": { "code": "GRAPHQL_VALIDATION_FAILED", "exception": { "stacktrace": [ "Field \"deleteState\" must not have a selection since type \"Boolean\" has no subfields.", "", "GraphQL request (2:30)", "1: mutation deleteState($id: ID!) {", "2: data: deleteState(id: $id) {", " ^", "3: id", "", " at Object.Field (/Users/kyle_pollich/Workspace/work/artifex-press/replatform/artifex-press-api/node_modules/graphql/validation/rules/ScalarLeafs.js:50:33)", " at Object.enter (/Users/kyle_pollich/Workspace/work/artifex-press/replatform/artifex-press-api/node_modules/graphql/language/visitor.js:343:29)", " at Object.enter (/Users/kyle_pollich/Workspace/work/artifex-press/replatform/artifex-press-api/node_modules/graphql/language/visitor.js:394:25)", " at visit (/Users/kyle_pollich/Workspace/work/artifex-press/replatform/artifex-press-api/node_modules/graphql/language/visitor.js:261:26)", " at Object.validate (/Users/kyle_pollich/Workspace/work/artifex-press/replatform/artifex-press-api/node_modules/graphql/validation/validate.js:63:22)", " at Promise.resolve.then (/Users/kyle_pollich/Workspace/work/artifex-press/replatform/artifex-press-api/node_modules/apollo-server-core/src/runQuery.ts:188:30)", " at <anonymous>", " at process._tickCallback (internal/process/next_tick.js:188:7)" ] } } } ] }