Skip to content

LuxChanLu/graphql-schema-to-ast

Repository files navigation

graphql-schema-to-ast

Build Coverage Status Downloads

How to use it

This library generate an AST Document with a schema and a query name Simple way : It generate a graphql query/mutation/subscrition from a schema with only the name of the operation (Yes it will include query all fields)

const GQLSchemaToAst = require('graphql-schema-to-ast')

const generatorFromInstrospectionResult = GQLSchemaToAst.fromIntrospection(introspectionQueryResult, optionalBuildClientSchemaOption)
const generatorFromSchema = GQLSchemaToAst.fromSchema(grapqhlSchema)

generatorFromInstrospectionResult.query('queryOne')
generatorFromInstrospectionResult.query('queryOne', 'queryTwo')
generatorFromSchema.query(['queryOne', 'queryTwo'])

generatorFromSchema.mutation('mutationOne')
generatorFromSchema.subscription('subscriptionOne')

About

Resolve graphql schema to an AST node

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published