The GraphQL specification allows us to add custom query directives. I'm looking for some information on how can I do this. I want to create a @include like a directive, but with more elaborate logic.
Apollo guide describes only adding scheme (i.e. working on the server) directive.
The @include directive can be used to include a field based on the value of the if argument. The query below would only include the authors for a post if includeAuthor GraphQL variable has a value true.
GraphQL Query
GraphQL variables