Skip to main content

Schema AST

This plugin prints the merged schema as string. If multiple schemas are provided, they will be merged and printed as one schema.

Installation

schema-ast plugin version
Using yarn
yarn add -D @graphql-codegen/schema-ast

API Reference

includeDirectives

type: boolean default: false

Include directives to Schema output.

Usage Examples

schema:
- './src/schema.graphql'
generates:
path/to/file.graphql:
plugins:
- schema-ast
config:
includeDirectives: true

commentDescriptions

type: boolean default: false

Set to true in order to print description as comments (using # instead of """)

Usage Examples

schema: http://localhost:3000/graphql
generates:
schema.graphql:
plugins:
- schema-ast
config:
commentDescriptions: true

sort

type: boolean default: false

Set to true in order get the schema lexicographically sorted before printed.

federation

type: boolean

Examples#

# ...
schema:
- 'http://localhost:3000/graphql'
- './src/**/*.graphql'
- 'scalar MyCustomScalar'
generates:
path/to/file.graphql:
plugins:
- schema-ast