-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid or incomplete schema is created when directives are defined and used. #3775
Comments
Thanks for reporting this. Could you please include answers to the questions that were presented to you in the issue template when you were opening this issue?
|
@abernix I hope these changes will suffice. |
Related issue here: ardatan/graphql-tools#842 The consensus appears to be that custom GraphQL scalars should not be used for validation going forward but to use alternative solutions like
What will Apollo's recommended approach to validation be? I think at least the docs at https://www.apollographql.com/docs/graphql-tools/schema-directives/#enforcing-value-restrictions should be updated to reflect the problems with the suggested solution. |
Thanks @mfellner for the update! |
Right now we are planning to remove support for |
GraphQL Playground as well as GraphQL code generator are throwing the following error:
Code:
If a scalar type
scalar DirScalarType
is added in the schema, the error goes away, but the directive fails to run without error.package.json:
The expected behavior.
run
npm run codegen
without error.run graphql playground without error.
The actual behavior.
Running
npm run codegen
throws an error complaining that the schema is invalid or incomplete.Running GraphQL Playground will run with error in DevTools Console and query completion will not work in editor.
A simple, runnable reproduction!
https://github.com/TanaseHagi/apollo-server-issue-3775/
The text was updated successfully, but these errors were encountered: