Package graphql.schema.idl
Class SchemaPrinter
- java.lang.Object
-
- graphql.schema.idl.SchemaPrinter
-
@PublicApi public class SchemaPrinter extends java.lang.Object
This can print an in memory GraphQL schema back to a logical schema definition
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SchemaPrinter.Options
Options to use when printing a schema
-
Field Summary
Fields Modifier and Type Field Description static java.util.function.Predicate<java.lang.String>
ExcludeGraphQLSpecifiedDirectivesPredicate
This predicate excludes all directives which are specified by the GraphQL Specification.
-
Constructor Summary
Constructors Constructor Description SchemaPrinter()
SchemaPrinter(SchemaPrinter.Options options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
directivesString(java.lang.Class<? extends GraphQLSchemaElement> parentType, GraphQLDirectiveContainer directiveContainer)
java.lang.String
print(Document schemaIDL)
This can print an in memory GraphQL IDL document back to a logical schema definition.java.lang.String
print(GraphQLDirective graphQLDirective)
java.lang.String
print(GraphQLSchema schema)
This can print an in memory GraphQL schema back to a logical schema definitionjava.lang.String
print(GraphQLType type)
java.lang.String
print(java.util.List<GraphQLSchemaElement> elements)
-
-
-
Constructor Detail
-
SchemaPrinter
public SchemaPrinter()
-
SchemaPrinter
public SchemaPrinter(SchemaPrinter.Options options)
-
-
Method Detail
-
print
public java.lang.String print(Document schemaIDL)
This can print an in memory GraphQL IDL document back to a logical schema definition. If you want to turn a Introspection query result into a Document (and then into a printed schema) then useIntrospectionResultToSchema.createSchemaDefinition(java.util.Map)
first to get theDocument
and then print that.- Parameters:
schemaIDL
- the parsed schema IDL- Returns:
- the logical schema definition
-
print
public java.lang.String print(GraphQLSchema schema)
This can print an in memory GraphQL schema back to a logical schema definition- Parameters:
schema
- the schema in play- Returns:
- the logical schema definition
-
directivesString
public java.lang.String directivesString(java.lang.Class<? extends GraphQLSchemaElement> parentType, GraphQLDirectiveContainer directiveContainer)
-
print
public java.lang.String print(GraphQLType type)
-
print
public java.lang.String print(java.util.List<GraphQLSchemaElement> elements)
-
print
public java.lang.String print(GraphQLDirective graphQLDirective)
-
-