-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[Modern] Error with .json schema #1639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
you should use schema.graphql instead of schema.json |
@sibelius |
.json is used on Relay Classic .graphql is used on Relay Modern |
@unirey you can parse |
@leethree could you provide a code example of it? |
This should work: import fs from 'fs';
import {
buildClientSchema,
printSchema,
} from 'graphql/utilities';
const schema = buildClientSchema(require('schema.json').data);
fs.writeFileSync(
`schema.graphql`,
printSchema(schema),
); |
@leebyron: What's your intuition, should we just support |
FWIW I'd appreciate if both formats were supported. I'm working with a graphql endpoint that currently only spits out the json form of the schema. I (now) understand there are workarounds, but I'm working on a react app that's currently ejected from |
It's easy for us to support both, so we should @kassens |
Fwiw the Babel plugin supports both. This just seems like a small oversight in the compiler |
Docs:
Log:
JSON file:
The text was updated successfully, but these errors were encountered: