Skip to content

Including unused directives in schema? #1972

Answered by dariuszkuc
terminalnode asked this question in Q&A
Discussion options

You must be logged in to vote

My thinking is that our frontend will be basing their client on the federated schema, so even if our directives are executed in the subgraph regardless it's useful that they're visible in the supergraph too.

AFAIK we (Apollo) don't preserve those custom schema directives in the API schemas (i.e. schemas that clients interact with). You can preserve them in the supergraph schema through @composeDirective but I believe they will be stripped out from API schema.

It does sound like maybe I want FIELD instead of FIELD_DEFINITION, but graphql-kotlin is not really happy with my using of FIELD. One of our directives is checking if a user has a role that's allowed to read certain data, and othe…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@terminalnode
Comment options

@dariuszkuc
Comment options

Answer selected by terminalnode
@dariuszkuc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants