graphql/utilities/schema-printing

Functions

printSchema()

Prints the schema.

Signature:

printSchema(schema: GraphQLSchema): string

Arguments

NameTypeDescription
schemaGraphQLSchemaThe GraphQL schema to use.

Returns

TypeDescription
stringThe printed string representation.

Example

import { printSchema } from 'graphql/utilities';
 
const result = printSchema(schema);
 
// result contains the printSchema return value

printIntrospectionSchema()

Prints the introspection schema.

Signature:

printIntrospectionSchema(schema: GraphQLSchema): string

Arguments

NameTypeDescription
schemaGraphQLSchemaThe GraphQL schema to use.

Returns

TypeDescription
stringThe printed string representation.

Example

import { printIntrospectionSchema } from 'graphql/utilities';
 
const result = printIntrospectionSchema(schema);
 
// result contains the printIntrospectionSchema return value

printType()

Prints the type.

Signature:

printType(type: GraphQLNamedType): string

Arguments

NameTypeDescription
typeGraphQLNamedTypeThe GraphQL type to inspect.

Returns

TypeDescription
stringThe printed string representation.

Example

import { printType } from 'graphql/utilities';
 
const result = printType(type);
 
// result contains the printType return value