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

feat: initial suport for applied directives #652

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dariuszkuc
Copy link
Contributor

Update type definitions to expose AppliedDirectives. This initial implementation only exposes applied directive as metadata and does not modify runtime wiring to process them. Exposing directives is a pre-req to enable support for Apollo Federation (related: #492).

Following the pattern from graphql-java and HotChocolate where they make distinction between directive type definition (i.e. directive @foo on FIELD_DEFINITION, maps to existing Directive struct for backwards compatibility) and where directives are actually applied within the schema (i.e. type Foo @bar { baz @qux }, maps to new AppliedDirective struct`).

Update type definitions to expose `AppliedDirective`s. **This initial implementation only exposes applied directive as metadata and does not modify runtime wiring to process them**. Exposing directives is a pre-req to enable support for [Apollo Federation](https://www.apollographql.com/docs/federation/) (related: graphql-go#492).

Following the pattern from [`graphql-java`](https://github.com/graphql-java/graphql-java) and [`HotChocolate`](https://github.com/ChilliCream/hotchocolate) where they make distinction between directive type definition (i.e. `directive @foo on FIELD_DEFINITION`, maps to existing `Directive struct` for backwards compatibility) and where directives are actually applied within the schema (i.e. `type Foo @bar { baz @Qux }`, maps to new `AppliedDirective` struct`).
@coveralls
Copy link

coveralls commented Oct 17, 2022

Coverage Status

Coverage decreased (-0.4%) to 91.607% when pulling 0cd84ad on dariuszkuc:applied_directives into 09272f3 on graphql-go:master.

@dariuszkuc
Copy link
Contributor Author

@chris-ramon can you help with merging this PR?

dariuszkuc added a commit to dariuszkuc/apollo-federation-subgraph-compatibility that referenced this pull request Oct 31, 2022
Example `graphql-go` integration that is using https://github.com/dariuszkuc/graphql/releases/tag/v0.9.0-federation

NOTE: this is a temporary solution while we are waiting for `graphql-go` PRs to get merged ([651](graphql-go/graphql#651), [652](graphql-go/graphql#652) and [653](graphql-go/graphql#653)).

Resolves: apollographql#74
dariuszkuc added a commit to apollographql/apollo-federation-subgraph-compatibility that referenced this pull request Nov 1, 2022
Example `graphql-go` integration that is using https://github.com/dariuszkuc/graphql/releases/tag/v0.9.0-federation

NOTE: this is a temporary solution while we are waiting for `graphql-go` PRs to get merged ([651](graphql-go/graphql#651), [652](graphql-go/graphql#652) and [653](graphql-go/graphql#653)).

Resolves: #74
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.

None yet

3 participants