1.0.0-rc.2 • Published 4 months ago
generate-graphql-introspection v1.0.0-rc.2
README
Generate introspection from GraphQL schema.
npm i generate-graphql-introspection --save-dev
Usage:
npx generate-graphql-introspection -s schema.graphql -o introspection.json
Command
Usage:
# All .graphql files in the graphql directory
generate-graphql-introspection -s "graphql/*.graphql" -o introspection.json
# Specify one file
generate-graphql-introspection -s graphql/schema.graphql -o introspection.json
# Specify multiple files
generate-graphql-introspection -s graphql/user.graphql -s graphql/order.graphql -o introspection.json
Options:
-s --source Specify the source glob.
-i --ignore Specify the rule to ignore files in source.
-o --output Specify the output file.
-h --help Print help message.
Programmatically usage
import { generateGraphQLIntrospection } from 'generate-graphql-introspection'
generateGraphQLIntrospection({
source: ['graphql/*.graphql'],
output: 'introspection.json'
})