Closed Shane32 closed 1 month ago
Name | Link |
---|---|
Latest commit | b9f1f3305e395bb522b85e412d0772476803f857 |
Latest deploy log | https://app.netlify.com/sites/graphql-spec-draft/deploys/67007a357700f600088a42dc |
Deploy Preview | https://deploy-preview-1098--graphql-spec-draft.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
The lack of this validation rule can be demonstrated in GraphQL.js with this:
import { GraphQLSchema, GraphQLInt, graphql, GraphQLObjectType } from 'graphql';
const Query = new GraphQLObjectType({
name: 'Query',
fields: {
a: {
type: GraphQLInt,
resolve() {
return 42;
},
},
},
});
const schema = new GraphQLSchema({
query: Query,
});
const result = await graphql({ schema, source: `mutation { __typename }` });
console.dir(result);
which produces:
{
data: null,
errors: [
GraphQLError: Schema is not configured to execute mutation operation.
at executeOperation [...]
path: undefined,
locations: [Array],
extensions: [Object: null prototype] {}
}
]
}
We should really mark this as an invalid request, and thus it should not have a data
key in the response.
This is a refresh of #955 which has a pending PR at the implementation https://github.com/graphql/graphql-js/pull/3601
Good spot @yaacovCR; it seems both @Shane32 and I had commented on that previous PR!
I have merged this PR into that PR and applied my own editorial edits on top of both:
Closes #1097