public static class SchemaPrinter.Options
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static SchemaPrinter.Options |
defaultOptions() |
SchemaPrinter.Options |
descriptionsAsHashComments(boolean flag)
Descriptions are defined as preceding string literals, however an older legacy
versions of SDL supported preceding '#' comments as
descriptions.
|
GraphqlTypeComparatorRegistry |
getComparatorRegistry() |
java.util.function.Predicate<java.lang.String> |
getIncludeDirective() |
java.util.function.Predicate<GraphQLSchemaElement> |
getIncludeSchemaElement() |
SchemaPrinter.Options |
includeDirectiveDefinitions(boolean flag)
This flag controls whether schema printer will include directive definitions at the top of the schema, but does not remove them from the field or type usage.
|
SchemaPrinter.Options |
includeDirectives(boolean flag)
Allow to print directives.
|
SchemaPrinter.Options |
includeDirectives(java.util.function.Predicate<java.lang.String> includeDirective)
This is a Predicate that decides whether a directive element is printed.
|
SchemaPrinter.Options |
includeIntrospectionTypes(boolean flag)
This will allow you to include introspection types that are contained in a schema
|
SchemaPrinter.Options |
includeScalarTypes(boolean flag)
This will allow you to include scalar types that are contained in a schema
|
SchemaPrinter.Options |
includeSchemaDefinition(boolean flag)
This will force the printing of the graphql schema definition even if the query, mutation, and/or subscription
types use the default names.
|
SchemaPrinter.Options |
includeSchemaElement(java.util.function.Predicate<GraphQLSchemaElement> includeSchemaElement)
This is a general purpose Predicate that decides whether a schema element is printed ever.
|
boolean |
isDescriptionsAsHashComments() |
boolean |
isIncludeDirectiveDefinitions() |
boolean |
isIncludeIntrospectionTypes() |
boolean |
isIncludeScalars() |
boolean |
isIncludeSchemaDefinition() |
boolean |
isUseAstDefinitions() |
SchemaPrinter.Options |
setComparators(GraphqlTypeComparatorRegistry comparatorRegistry)
The comparator registry controls the printing order for registered
GraphQLType s. |
SchemaPrinter.Options |
useAstDefinitions(boolean flag)
This flag controls whether schema printer will use the
GraphQLType 's original Ast TypeDefinition s when printing the type. |
public boolean isIncludeIntrospectionTypes()
public boolean isIncludeScalars()
public boolean isIncludeSchemaDefinition()
public boolean isIncludeDirectiveDefinitions()
public java.util.function.Predicate<java.lang.String> getIncludeDirective()
public java.util.function.Predicate<GraphQLSchemaElement> getIncludeSchemaElement()
public boolean isDescriptionsAsHashComments()
public GraphqlTypeComparatorRegistry getComparatorRegistry()
public boolean isUseAstDefinitions()
public static SchemaPrinter.Options defaultOptions()
public SchemaPrinter.Options includeIntrospectionTypes(boolean flag)
flag
- whether to include thempublic SchemaPrinter.Options includeScalarTypes(boolean flag)
flag
- whether to include thempublic SchemaPrinter.Options includeSchemaDefinition(boolean flag)
flag
- whether to force include the schema definitionpublic SchemaPrinter.Options includeDirectiveDefinitions(boolean flag)
In some schema definitions, like Apollo Federation, the schema should be printed without the directive definitions. This simplified schema is returned by a GraphQL query to other services, in a format that is different that the introspection query.
On by default.
flag
- whether to print directive definitionspublic SchemaPrinter.Options includeDirectives(boolean flag)
flag
- whether to print directivespublic SchemaPrinter.Options includeDirectives(java.util.function.Predicate<java.lang.String> includeDirective)
includeDirective
- the predicate to decide of a directive is printedpublic SchemaPrinter.Options includeSchemaElement(java.util.function.Predicate<GraphQLSchemaElement> includeSchemaElement)
includeSchemaElement
- the predicate to decide of a schema is printedpublic SchemaPrinter.Options useAstDefinitions(boolean flag)
GraphQLType
's original Ast TypeDefinition
s when printing the type. This
allows access to any `extend type` declarations that might have been originally made.flag
- whether to print via AST type definitionspublic SchemaPrinter.Options descriptionsAsHashComments(boolean flag)
flag
- whether to print description as # commentspublic SchemaPrinter.Options setComparators(GraphqlTypeComparatorRegistry comparatorRegistry)
GraphQLType
s.
The default is to sort elements by name but you can put in your own code to decide on the field order
comparatorRegistry
- The registry containing the Comparator
and environment scoping rules.