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

API for setting custom directives #916

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

yanns
Copy link
Contributor

@yanns yanns commented Oct 6, 2022

Prototype for #913
In this prototype, we check how we can apply custom directives much easier.
Furthermore, we check if we can prove type safety, to that a custom directive
that can be applied on some elements cannot be applied on others.

Limitations:

  • a directive can be applied on a field definition for example. With that current approach,
    we cannot formulate that with the type system as a field definition lives in sangria.ast, and
    we only handle sangria.schema types.
  • we are introducing new types to mark on which elements a directive can be applied. Those types
    are kind of duplication of the current sangria.schema.DirectiveLocation values.

@yanns yanns force-pushed the custom_directive_API branch 2 times, most recently from 8fe1f86 to 99eab24 Compare October 6, 2022 09:12
Prototype for #913
In this prototype, we check how we can apply custom directives much easier.
Furthermore, we check if we can prove type safety, to that a custom directive
that can be applied on some elements cannot be applied on others.

Limitations:
- a directive can be applied on a field definition for example. With that current approach,
we cannot formulate that with the type system as a field definition lives in sangria.ast, and
we only handle sangria.schema types.
- we are introducing new types to mark on which elements a directive can be applied. Those types
are kind of duplication of the current [sangria.schema.DirectiveLocation values](https://github.com/sangria-graphql/sangria/blob/f339b5df97bd89c2a24fcfc977a1f20191ffd7fc/modules/core/src/main/scala/sangria/schema/Schema.scala#L1136-L1158).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant