Urigo / graphql-cli

📟 Command line tool for common GraphQL development workflows

Home Page:https://graphql-cli.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

get-schema discards custom directives?

mdecurtins opened this issue · comments

I'm trying to generate a SDL dump of my schema, and it appears that the generated SDL ignored all my custom schema directives and fields I annotated with those directives. get-schema appears to keep directives defined by the GraphQL spec, e.g. @deprecated, but discards custom directives.

Can anyone confirm this is a current limitation of get-schema? Is there any way to get my directives into the generated SDL?

What I did:

npm install -g graphql-cli
graphql get-schema --endpoint http://localhost:4000/graphql --output schema.graphql

Using:

  • graphql-cli: 3.0.14
  • apollo-server-express: 2.4.8
  • graphql: 14.2.1

EDIT: I'm aware that introspection doesn't pick up custom directives (graphql/graphql-spec#300 and graphql/graphql-js#1072) but I'm wondering if Apollo has a way to get at them?

We've just released a new alpha version channel for GraphQL CLI - 4.0.0-alpha.XXX!

We've changed the get-schema command to use GraphQL Code Generator plugin of GraphQL CLI with the Codegen's schema-ast plugin which can handle directives.

Checkout new instructions in the migration guide and let us know your feedback during that alpha period!

Feel free to contact us by opening a new issue or joining our Discord channel;
https://discord.gg/xud7bH

I've posted the wrong Discord link, this is the correct one: https://discord.gg/xud7bH9