Open frankchen211 opened 4 years ago
Have you set the errorPolicy? https://www.apollographql.com/docs/react/data/error-handling/
have same issue, but with $apollo.mutate
, I can confirm options { errorPolicy: 'all' }
is passed into the client.mutate
and i've tried to set it as the defaultOptions
, function but e.graphQLErrors?.length === 0
is empty. I can see the error coming back from the response:
{
"errors": [
{
"message": "Variable \"$documents\" is never used in operation \"CreateCertificationLog\".",
"locations": [
{
"line": 1,
"column": 154
}
],
"stack": "GraphQLError: Variable \"$documents\" is never used in operation \"CreateCertificationLog\".\n at Object.leave (/app/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js:38:33)\n at Object.leave (/app/node_modules/graphql/language/visitor.js:344:29)\n at Object.leave (/app/node_modules/graphql/utilities/TypeInfo.js:390:21)\n at visit (/app/node_modules/graphql/language/visitor.js:243:26)\n at Object.validate (/app/node_modules/graphql/validation/validate.js:69:24)\n at parseQuery (/app/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:270:48)\n at /app/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:680:63\n at Array.map (<anonymous>)\n at graphqlRouteHandler (/app/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:643:52)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
}
]
}
Trying to trace the error seems impossible, as all the client function calls for mutate don't appear to be used. Somehow, whatever $apollo.mutate is using to perform the mutation is bypassing everything and not taking the options.
quite confusing.
When gql return query results with errors, empty object returned from update or result option.
How can I get the data by calling apollo query even query has some errors?
Results returned from GrahqiQL:
Results from apollo smart query: