Directives in the docs


#1

Hi,

Am I correct in saying that apollo server supports directives, but there is no explanation about that support in the docs?

Scott


#2

I’m not sure what you mean by “directives” - is that something beyond just @skip and @include? There isn’t anything special about Apollo Server – it uses GraphQL.js and supports all of GraphQL so it doesn’t seem like we need to list every feature of GraphQL?


#3

Hi Sashko,

This is probably just my own ignorance, but what would tell me which GraphQL features apollo server supports?

My interest is more in how to create and best use custom directives, which from what I’ve read are said to be available, but aren’t really documented on how to create and use them.

Scott


#4

Custom directives are not really supported in any GraphQL server right now.


#5

Thank you for the references.

I’m surprised that custom directives aren’t supported yet. I would have thought that is how some flexibility would be provided, when something is needed outside the GraphQL spec. Or is my understanding of custom directives possibly incorrect?

This article is what makes me think that is what custom directives are really for.

Scott


#6

The problem is that custom directives need to be implemented at the execution engine level - i.e. you would need to fork the reference implementation itself: https://github.com/graphql/graphql-js

Currently we are not interested in doing that at all. But I bet if you forked it, the result would still work fine with graphql-tools and graphql-server.