Skip to content
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

[RFC] Directives in schema language #318

Merged
merged 2 commits into from
Mar 22, 2016
Merged

Conversation

leebyron
Copy link
Contributor

This adds directives to schema language and to the utilities that use it (schema parser, and buildASTSchema). Directives are one of the few missing pieces from representing a full schema in the schema language.

Note: the schema language is still experimental, so there is no corresponding change to the spec yet.

DirectiveDefinition :

  • directive @ Name ArgumentsDefinition? on DirectiveLocations

DirectiveLocations :

  • Name
  • DirectiveLocations | Name

Example:

directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT

# Suggested formatting when there are many valid locations
directive @include(if: Boolean!)
  on FIELD
   | FRAGMENT_SPREAD
   | INLINE_FRAGMENT

Note: this depends on #317

[RFC] Proposed change to directive location introspection
This adds directives to schema language and to the utilities that use it (schema parser, and buildASTSchema). Directives are one of the few missing pieces from representing a full schema in the schema language.

Note: the schema language is still experimental, so there is no corresponding change to the spec yet.

DirectiveDefinition :
  - directive @ Name ArgumentsDefinition? on DirectiveLocations

DirectiveLocations :
  - Name
  - DirectiveLocations | Name

Example:

```
directive @Skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT

directive @include(if: Boolean!)
  on FIELD
   | FRAGMENT_SPREAD
   | INLINE_FRAGMENT
```
@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 99.317% when pulling b633458 on directive-lang into e89c19d on fine-grain-directives.

leebyron added a commit that referenced this pull request Mar 22, 2016
[RFC] Directives in schema language
@leebyron leebyron merged commit 345db59 into fine-grain-directives Mar 22, 2016
@leebyron leebyron deleted the directive-lang branch March 22, 2016 22:18
@leebyron
Copy link
Contributor Author

Merged into master in fdafe32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants