broccoli-cashay-schema
Convert a server graphql schema into a client-safe schema to use with Cashay.
Compatible with graphql ^0.8.2 and cashay ^0.22.1. (You must install them yourself)
npm i --save graphql
npm i --save cashay
Installation
npm i --save broccoli-cashay-schema
Quick Start
Create a server schema, e.g.:
// server/schema-builder.js ; const query = name: 'RootQueryType' fields: hello: type: GraphQLString { return 'world'; } ; ;
broccoli-cashay-schema will convert the schema into a new client-safe schema, and then write it back out to a path that you specify.
Usage
Note: You must bring your own graphql and cashay
var cashaySchemaGenerator = ;var cashay = ;var graphql = ; // The plugin will look for a schema.js file in the node you provide// You can override with the option `serverSchemaPath`var node = ;
ES6 Syntax
If you are (likely) using ES6 (ECMAScript 2015), you will need to transpile the schema file before passing it to broccoli-cashay-schema.
This can be done easily with broccoli-babel-transpiler:
var esTranspiler = ; var node = ;
License
This project is distributed under the MIT license