1.0.0 • Published 8 years ago

flow-graphql-webpack-plugin v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

flow-graphql-webpack-plugin

A webpack plugin that takes a GraphQL schema and generates useful things from it.

Currently it only searches types for enums and generates constants from it. In the future, I'd like it to output flow type annotations as well.

Usage

Add it to your webpack config as per usual for a plugin:

plugins: [
  new FlowGraphQLPlugin(options)
]

The options object takes the following shape:

KeyRequiredDescriptionDefault
schemaPathYesPath to your GraphQL schema.json file.n/a
outputPathYesPath where you want the generated constants to go.n/a
fileNameNoName of the constants file.enum.js
toTypesNoDot-notation path to the location of types in your schema.data.__schema.types
enumTypeKindNoType kind for enumsENUM
enumTemplateNoOutput template format for each enum.Function (look in source)