mix graphql_gen_markdown (Graphql Markdown v1.2.0)

Copy Markdown View Source

A mix task to convert a GraphQL JSON schema to markdown

usage

mix graphql_gen_markdown [OPTIONS]

valid override args: -f, --schema Path to the introspection JSON file -s, --schema-module Absinthe schema module to introspect in-process

                      (requires absinthe in your deps). Use one of -f or -s

-o, --output-dir Where to output the files. Default: [Current Directory]

                      Use - to write a single page to stdout instead

-m, --multi-page Generate each type in a separate file. Default: [single page format] -t, --title Specify the page title for the generated file (Applies to single file and index.md) --no-toc Do not generate the table of content (Applies to single file only) -d, --depth How many nested levels the example operations select. Default: 2 --check Do not write anything; fail when the files in the output

                      directory differ from what would be generated

--link-ext Extension of the links between multi-page files: html

                      (default, for ExDoc), md (GitHub, MkDocs) or none (clean
                      URLs, Docusaurus)

--front-matter Start every page with a YAML block holding its title --backlinks End every type with the operations returning it and the

                      types and operations using it

Examples

  1. Convert the GraphQL JSON schema to a single markdown file
mix graphql_gen_markdown -f myschema.json
  1. Convert the GraphQL JSON schema to a multiple markdown file
mix graphql_gen_markdown -f myschema.json -m
  1. Introspect an Absinthe schema directly, without an intermediate JSON file
mix graphql_gen_markdown -s MyApp.Schema -o guides
  1. Write the single page to stdout, for example to copy it
mix graphql_gen_markdown -f myschema.json -o - | pbcopy
  1. In CI, fail when the committed markdown is out of date
mix graphql_gen_markdown -s MyApp.Schema -o guides/graphql -m --check