graphql/utilities/schema-printing
Functions
printSchema()
Prints the schema.
Signature:
printSchema(schema: GraphQLSchema): string
Arguments
| Name | Type | Description |
|---|---|---|
| schema | GraphQLSchema | The GraphQL schema to use. |
Returns
| Type | Description |
|---|---|
string | The printed string representation. |
Example
import { printSchema } from 'graphql/utilities';
const result = printSchema(schema);
// result contains the printSchema return valueprintIntrospectionSchema()
Prints the introspection schema.
Signature:
printIntrospectionSchema(schema: GraphQLSchema): string
Arguments
| Name | Type | Description |
|---|---|---|
| schema | GraphQLSchema | The GraphQL schema to use. |
Returns
| Type | Description |
|---|---|
string | The printed string representation. |
Example
import { printIntrospectionSchema } from 'graphql/utilities';
const result = printIntrospectionSchema(schema);
// result contains the printIntrospectionSchema return valueprintType()
Prints the type.
Signature:
printType(type: GraphQLNamedType): string
Arguments
| Name | Type | Description |
|---|---|---|
| type | GraphQLNamedType | The GraphQL type to inspect. |
Returns
| Type | Description |
|---|---|
string | The printed string representation. |
Example
import { printType } from 'graphql/utilities';
const result = printType(type);
// result contains the printType return value