【文件属性】:
文件名称:graphql-to-json-schema:GraphQL架构到JSON架构
文件大小:82KB
文件格式:ZIP
更新时间:2021-02-03 06:15:36
nodejs graphql typescript json-schema GraphQLTypeScript
GraphQL架构到JSON架构
graphql-2-json-schema软件包
将GraphQL Schema自检文件转换为有效的JSON Schema。
用法
import {
graphqlSync ,
introspectionQuery ,
IntrospectionQuery
} from 'graphql' ;
import { fromIntrospectionQuery } from 'graphql-2-json-schema' ;
// schema is your GraphQL schema.
const introspection = graphqlSync ( schema , introspectionQuery ) . data as IntrospectionQuery ;
const result = fromIntrospectionQuery ( introspection ) ;
例
输入值
type Todo {
id : String !
name : String !
【文件预览】:
graphql-to-json-schema-master
----.nvmrc(6B)
----package.json(1KB)
----tslint.json(3KB)
----__tests__()
--------spec.ts(676B)
----RELEASING.md(363B)
----.prettierignore(6B)
----LICENSE(1KB)
----package-lock.json(291KB)
----.npmignore(92B)
----config.yml(979B)
----tsconfig.json(261B)
----.gitignore(920B)
----CHANGELOG.md(2KB)
----lib()
--------fromIntrospectionQuery.ts(2KB)
--------typesMapping.ts(2KB)
--------reducer.ts(5KB)
--------typeGuards.ts(3KB)
--------fromGraphQLSchema.ts(199B)
----.circleci()
--------config.yml(1KB)
----test-utils.ts(8KB)
----README.md(6KB)
----index.ts(85B)
----doc-exampleGenerator.ts(3KB)
----.prettierrc.json(86B)