Class GraphQLMarkdownGenerator

java.lang.Object
org.brapi.schematools.core.markdown.GraphQLMarkdownGenerator

public class GraphQLMarkdownGenerator extends Object
Generates a Markdown files for type and their field descriptions from a GraphQL Schema. For each type in the schema a Markdown file with the same name as the type will be created. For each field in a type a Markdown file with same name as the type will be created. For each field in the Query type in the schema a Markdown file with the same name as the field will be created. For each argument for each field in the Query type in a type a Markdown file with same name as the type will be created.

See the options to configure the generator

  • Field Details

    • LIST_RESPONSE_PATTERN

      public static final Pattern LIST_RESPONSE_PATTERN
      Pattern for List Response names
    • SEARCH_RESPONSE_PATTERN

      public static final Pattern SEARCH_RESPONSE_PATTERN
      Pattern for Search Response names
    • RESPONSE_PATTERN

      public static final Pattern RESPONSE_PATTERN
      Pattern for other Response names
    • INPUT_PATTERN

      public static final Pattern INPUT_PATTERN
      Pattern for Input names
  • Method Details

    • generator

      public static GraphQLMarkdownGenerator generator(Path outputPath)
      Creates the default Generator.
      Parameters:
      outputPath - the output path for markdown files.
      Returns:
      the default Generator
    • outputPath

      public GraphQLMarkdownGenerator outputPath(Path outputPath)
      Sets the output path.
      Parameters:
      outputPath - the output path for markdown files.
      Returns:
      the writer for method chaining
    • options

      Overwrite the files if present.
      Parameters:
      options - the generator options
      Returns:
      the writer for method chaining
    • generate

      public Response<List<Path>> generate(graphql.schema.GraphQLSchema schema)
      Generates Markdown files for type definitions and their field descriptions, query definitions and their arguments descriptions from the GraphQL schema
      Parameters:
      schema - the path to the complete BrAPI Specification
      Returns:
      the paths of the Markdown files generated from the complete BrAPI Specification