prisma-labs / get-graphql-schema

Fetch and print the GraphQL schema from a GraphQL HTTP endpoint. (Can be used for Relay Modern.)
669 stars 62 forks source link

get-graphql-schema Relay Schema with commas for multiple inheritance separators rejected by FB Relay Compiler #21

Open kguller opened 6 years ago

kguller commented 6 years ago

I am using a generated schema from Graph.Cool that has the User type implementing two interfaces: Node and AnonymousUser. This looks like standard multiple inheritance. The Relay Compiler rejects this, however if I use an ampersand it works (implements Node & AnonymousUser vs. implements Node, AnonymousUser). A change in the SDL spec seems to have caused the get-graphql-schema to fall out of date.

Reproduction I'm able to reproduce this consistently

Expected behavior? Commas should be converted to ampersands when listing inheritance references. FB Relay Team feedback confirms:

This is due to a change in the SDL spec that was implemented in graphql-js v0.13. While graphql-js can technically accept an option to enable legacy parsing, it is not exposed in relay-compiler. The simplest way to make this work would be to make get-graphql-schema work with graphql-js v0.13

https://github.com/facebook/relay/issues/2364

vinicio commented 6 years ago

Hi, @kguller!

Consider using https://github.com/graphql-cli/graphql-cli. It's more active and with a more recent version of graphql-js.

kguller commented 6 years ago

@vinicio thank you! Works perfectly!

cancan101 commented 2 years ago

Hi, @kguller!

Consider using https://github.com/graphql-cli/graphql-cli. It's more active and with a more recent version of graphql-js.

What is the subcommand that is roughly comparable?