0.0.1 • Published 5 years ago

@kickstarter/binding v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Install

yarn add @kickstarter/binding

Setup

Create a .bind-graphqlrc or bind-graphql.config.js that exports the following options

schema: string

Relative path or URL to GraphQL schema (default: "./schema.graphql")

output: string

Relative path of output schema declaration file (default: "./schema.d.ts")

files: string

Glob for GraphQL files to compile (default: "**/*.graphql")

print: boolean

Do not write schema file, and instead print the result (default: false)

Use

Use @kickstarter/binding/graphql-webpack-loader as your Webpack loader for GraphQL files.

Use @kickstarter/binding/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