graphql-go / graphql

An implementation of GraphQL for Go / Golang
MIT License
9.89k stars 840 forks source link

feat: initial suport for applied directives #652

Open dariuszkuc opened 1 year ago

dariuszkuc commented 1 year ago

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: https://github.com/graphql-go/graphql/issues/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`).

coveralls commented 1 year ago

Coverage Status

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

dariuszkuc commented 1 year ago

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