graphql-schema-to-ast

1.0.0 • Public • Published

graphql-schema-to-ast

Build Status Coverage Status Codacy Badge Maintainability David 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')

Readme

Keywords

none

Package Sidebar

Install

npm i graphql-schema-to-ast

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

8.18 kB

Total Files

4

Last publish

Collaborators

  • hugome