@ryanchenkie
"Directives provide a way to describe alternate runtime execution and type validation behavior in a GraphQL document."
– GraphQL Spec 2.12 (June 2018 release)
"GraphQL implementations should provide the @skip and @include directives."
– GraphQL Spec 3.13 (June 2018 release)
"GraphQL implementations that support the type system definition language must provide the @deprecated directive if representing deprecated portions of the schema."
– GraphQL Spec 3.13 (June 2018 release)
SchemaDirectiveVisitor
visitFieldDefinition
visitObject
visitSchema
visitScalar
visitArgumentDefinition
visitInterface
visitUnion
visitEnum
visitEnumValue
visitInputObject
visitInputFieldDefinition
What is the directive named?
What arguments does it take?
Where does it work?
Put the directive on any fields desired
Target field definitions
Get the argument passed in
Resolve the field with "something different"
Register the schema directive
npm install graphql-middleware
bit.ly/schema-directives
@ryanchenkie