question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add validation of directives in SDL

See original GitHub issue

From #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 enforce Directives Are Unique Per Location until 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:open
  • Created 5 years ago
  • Reactions:2
  • Comments:16 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
yaacovCRcommented, Jan 18, 2021

Well, validated in a sense that the directives have to exist, I don’t know if the arguments are validated / coerced yet…

1reaction
IvanGoncharovcommented, Jul 30, 2018

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found