0.1.7 • Published 4 years ago
bind v0.1.7
Install
yarn add bind
Setup
Create a .bindrc
or bind.config.js
that exports the following options
graphql.schema: string
Relative path or URL to GraphQL schema (default: "./schema.graphql")
graphql.output: string
Relative path of output schema declaration file (default: "./schema.d.ts")
graphql.files: string
Glob for GraphQL files to compile (default: "**/*.graphql")
graphql.print: boolean
Do not write schema file, and instead print the result (default: false)
Use
Use bind/graphql-webpack-loader
as your Webpack loader for GraphQL files.
Use bind/graphql-jest-transform
as your Jest transform for GraphQL files.
Run yarn bind:graphql
to create type definitions for all GraphQL files.
Import .graphql
files directly into your TypeScript file.
Generated code
TODO?