在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mhallin/graphql-docs开源软件地址(OpenSource Url):https://github.com/mhallin/graphql-docs开源编程语言(OpenSource Language):JavaScript 74.7%开源软件介绍(OpenSource Introduction):GraphQL Documentation ExplorerDynamically generated documentation explorer for GraphQL schemas. It aims to provide a better overview of a schema than GraphiQL, but without querying features. Installation and usageGraphQL-Docs supports both a dynamic mode and a static mode. In dynamic mode, GraphQL-Docs tries to work similarly to GraphiQL. Either use the minified files from GitHub: <script src="https://github.com/mhallin/graphql-docs/releases/download/v0.2.0/graphql-docs.min.js"></script>
<!-- Note that you need to include React and ReactDOM *before* this script tag --> Or download it into your own package via NPM: npm install --save graphql-docs GraphQL-Docs exposes a single React component that requires a function to run a
query against a server and return a function fetcher(query) {
return fetch(window.location.origin + '/graphql', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
query: query,
}),
}).then(function(r) {
return r.json();
});
}
ReactDOM.render(<GraphQLDocs.GraphQLDocs fetcher={fetcher} />, document.body); All CSS is included in the Javascript code, so no other dependencies are required. You can find examples of both the first and second paradigms in the examples folder. Static documentation generationYou can also generate a static documentation file based on a schema file or GraphQL endpoint: npm install -g graphql-docs
graphql-docs-gen http://GRAPHQL_ENDPOINT documentation.html Features
Planned features
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论