Class SchemaPrinter


  • @PublicApi
    public class SchemaPrinter
    extends java.lang.Object
    This can print an in memory GraphQL schema back to a logical schema definition
    • Field Detail

      • ExcludeGraphQLSpecifiedDirectivesPredicate

        public static final java.util.function.Predicate<java.lang.String> ExcludeGraphQLSpecifiedDirectivesPredicate
        This predicate excludes all directives which are specified by the GraphQL Specification. Printing these directives is optional.
    • Constructor Detail

      • SchemaPrinter

        public SchemaPrinter()
    • 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 use IntrospectionResultToSchema.createSchemaDefinition(java.util.Map) first to get the Document 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
      • print

        public java.lang.String print​(GraphQLType type)