@gqless/schema
v1.0.0-alpha.33
Published
Creates a `gqless` schema from a GraphQL endpoint.
Downloads
14
Readme
@gqless/schema
Creates a gqless
schema from a GraphQL endpoint.
- Codegen (typesafe) - outputs an array containing JS sourcecode, used by the CLI
- Runtime (not-typesafe) - creates a schema in the browser/node without codegen
Usage
Codegen
import { Codegen, fetchSchema } from '@gqless/schema'
const schemaDefs = await fetchSchema(fetchQuery)
const codegen = new Codegen(schemaDefs, { typescript: true })
const files = codegen.generate()
// => { path: string, contents: string }[]