开源软件名称(OpenSource Name):exogen/graphql-markdown开源软件地址(OpenSource Url):https://github.com/exogen/graphql-markdown开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):This package will generate Markdown that beautifully renders your GraphQL schema in an easily explorable document. $ yarn add graphql-markdown --dev
$ npm install graphql-markdown --save-dev See an example generated from the GraphBrainz schema. UsageCommand Line APIInstalling the package adds a The schema may be retrieved from a GraphQL endpoint: $ graphql-markdown http://your-server.com/graphql > schema.md …or a module exporting an instance of $ graphql-markdown ./path/to/schema.js > schema.md …or a file containing GraphQL syntax: $ graphql-markdown ./path/to/schema.graphql > schema.md …or a file containing the JSON output of an introspection query: $ graphql-markdown ./path/to/schema.json > schema.md If Options$ graphql-markdown --help
Usage: graphql-markdown [options] <schema>
Output a Markdown document with rendered descriptions and links between types.
The schema may be specified as:
- a URL to the GraphQL endpoint (the introspection query will be run)
- a GraphQL document containing the schema (.graphql or .gql)
- a JSON document containing the schema (as returned by the introspection query)
- an importable module with the schema as its default export (either an instance
of GraphQLSchema or a JSON object)
Options:
--title <string> Change the top heading title (default: 'Schema Types')
--no-title Do not print a default title
--no-toc Do not print table of contents
--prologue <string> Include custom Markdown after the title
--epilogue <string> Include custom Markdown after everything else
--heading-level <num> Heading level to begin at, useful if you are embedding the
output in a document with other sections (default: 1)
--update-file <file> Markdown document to update (between comment markers) or
create (if the file does not exist)
--require <module> If importing the schema from a module, require the specified
module first (useful for e.g. babel-register)
--header <name=value> Additional header(s) to use in GraphQL request
e.g. --header "Authorization=Bearer ey..."
--version Print version and exit Node APIThe following functions are exported from the loadSchemaJSON(schemaPath: string, options: object)Given a string pointing to a GraphQL schema (URL, module, or file path), get the
result of the introspection query, suitable for use as input to renderSchema(schema: object, options: object)Given a schema JSON object (the output of the introspection query, an object
with a Options
updateSchema(path: string, schema: object, options: object)Given a path to a Markdown document, inject the output of If the file does not exist, it will be created. If the document is empty, the necessary comment markers will automatically be inserted, but if there is existing content and no comment markers, the Promise will be rejected with an error. diffSchema(oldSchema: object, newSchema: object, options: object)Given two schema JSON objects (the results of the introspection query on two
schemas), return a new schema JSON object containing only the added or updated
types and fields. You can use this to document a schema update, or to document
the effects of a schema extension (e.g. Options
OutputOutput is optimized for display on GitHub, using GitHub Flavored Markdown. Due to the complexity of the tables in the generated document, much of the table output is raw HTML (as allowed by Markdown). |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论