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')