Converts a JSON Graphql Schema to Markdown
If available in Hex, the package can be installed
by adding graphql_markdown
to your list of dependencies in mix.exs
:
def deps do
[
{:graphql_markdown, "~> 0.1.2"}
]
end
And run:
$ mix deps.get
# will create a single file called graphql_schema.md in the current dir
$ mix graphql_gen_markdown -f ./schema.json
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/graphql_markdown.
You can generate either single page with all the types or a multipage that will then generate separately Mutations, Queries, Enums etc, each in a different file.
When you run the following
mix graphql_gen_markdown -f ./schema.json
it will generate the following file in your current folder:
./graphql_schema.md
You can change the default title for the single page with -t
option.
When you run the following
mix graphql_gen_markdown -f ./schema.json -m
it will generate the following files in your current folder:
./queries.md ./mutations.md ./objects.md ./inputs.md ./enums.md ./scalars.md ./interfaces.md ./unions.md
Documentation is available on Hexdocs
- Fork it!
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Emmanuel Pinault (@epinault)
is released under the MIT License. See the LICENSE file for further details.