-
Notifications
You must be signed in to change notification settings - Fork 18
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
Use Introspection Query as Schema #65
Comments
You can always convert introspection query json to schema.graphql import { printSchema, buildClientSchema } from 'graphql';
const schema = printSchema(buildClientSchema(introspectionQueryJSON));
// write schema to schema.graphql and use it
The support was intentionally not added as this package also support writing schema files and I do not want to complicate .gqlconfig structure. |
Was there ever support added for this? I think it would be extremely nice to have. |
I don't know what graphql version the previous comments were referring to, but the proper command for at least [email protected] is: import { printSchema, buildClientSchema } from 'graphql';
const introspectionQueryJSON = //getitfromsomewhere...
const schema = printSchema(buildClientSchema(introspectionQueryJSON));
// not introspectionQueryJSON.__schema
// write schema to schema.graphql and use it the |
@ndonnellan Thanks, I have fixed the comment. |
I was wondering if its possible to expand the functionality of this tool to be able to ingest an introspection query json similar to how eslint-plugin-graphql handles validation.
For my project, I don't always have the
*.gql
schema types available locally, but I'm able to grab the introspection query json.I'd be happy to take a look at adding support if I could maybe get pointed in the right direction for where to start digging in!
The text was updated successfully, but these errors were encountered: