Stitch together GraphQL fenced code blocks inside GitHub issues as an executable schema.
My team is using GitHub Issues to collaborate on different parts of our GraphQL schema. Each distinct part of the schema includes a fenced code block, allowing us to build our schema in pieces. See this repo's issues for an example of how this looks.
graphql-frankenstein will grab each graphql
fenced code block across a repo's issue and build a working schema.
graphql-frankenstein only needs 2 things: A repository where your graphql
issues are defined, and a list of labels to filter those issues (e.g. only build a schema from issues labeled with #frankenstein
in flesch/graphql-frankenstein).
graphql-frankenstein can be used as either a dependency in your Node project, or a standalone CLI app.
$ npm install --save graphql-frankenstein
const frankenstein = require('graphql-frankenstein');
const { GraphQLSchema } = require('graphql');
frankenstein('flesch/graphql-frankenstein', ['#frankenstein'])
.then(schema => {
console.log(schema instanceof GraphQLSchema);
}).catch(e => console.error(e));
$ npm install --global graphql-frankenstein
$ frankenstein --help
Usage
$ frankenstein <repository> --labels <labels>
$ frank <repository> -l <labels>
Options
--labels, -l A comma separated list of issue labels.
--verbose, -v Print errors instead of failing silently.
Examples
$ frankenstein flesch/graphql-frankenstein --labels "#frankenstein"
$ frank flesch/graphql-frankenstein -l frankenstein,publish
$ frankenstein flesch/graphql-frankenstein -l publish > schema.graphql
MIT © John Flesch