Skip to content
This repository has been archived by the owner on May 18, 2018. It is now read-only.

HsuTing/cat-graphql

Repository files navigation

Cat-graphql NPM version Build Status

Use to build schema.graphql for babel-plugin-relay, and other function with graphql. You can see examples.

How to use

front end

RelayTypes
import relayTypes from 'cat-graphql';

groupFields: relayTypes({
  fields: PropTypes.string.isRequired,
})

/*
This will be equal to:
groupFields: PropTypes.shape({
  edges: PropTypes.arrayOf(
    PropTypes.shape({
      node: PropTypes.shape({
        fields: PropTypes.string.isRequired,
      }).isRequired
    })  
  ).isRequired
})
*/

bin

build-graphql

Use to build graphql schema for babel-plugin-relay.

build-graphql [schema path] [arguments]

Arguments:

  • --path, -p: Set the path of the output file.
  • --name, -n: Set the name of the output file.
  • --schema, -s: Set the source schema which is wrote by graphql.js.

License

MIT © hsuting

About

Use to build schema.graphql.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published