add validation of directives in SDL
See original GitHub issueFrom #1383:
It’s very critical to add validation of directives in SDL since as noted here no one validates them correctly at the moment. That will lead to a situation very similar to the recent
Allow interfaces to have no implementors. Since spec defines set of validation rules but no one implements them. Probably we shouldn’t enforceDirectives Are Unique Per Locationuntil https://github.com/facebook/graphql/issues/429 resolved but all other validation should be implemented e.g. require the schema to contain applied directives, correct directive arguments, etc.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:16 (13 by maintainers)
Top Results From Across the Web
GraphQL validation using directives
A new option: Validation with schema directives It's possible to add this logic directly to your SDL using a new module: graphql-constraint- ...
Read more >Directives SDL – GraphQL Tools
Using SDL directives, a subservice may express its complete schema and type merging configuration in a single document. See related handbook ...
Read more >Directives | RedwoodJS Docs
Note: you can chain directives to first validate and then transform, such as @requireAuth @maskedEmail .
Read more >Adding directives to the schema in code-first GraphQL servers
Thus, if we don't have an SDL, we can still embed the directive into the query on runtime. Decoupling the requested and executable...
Read more >Directives - Hot Chocolate v13 - ChilliCream GraphQL Platform
Directives provide a way to add metadata for client tools such as code generators ... of GraphQL documents and type-system directives to annotate...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Well, validated in a sense that the directives have to exist, I don’t know if the arguments are validated / coerced yet…
@mjmahone Update: I finally figured out how to solve the last major problem. I will open a couple of PRs implementing this feature in the next few hours.