Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

Stitch together GraphQL fenced code blocks inside GitHub issues into an executable schema.

License

Notifications You must be signed in to change notification settings

flesch/graphql-frankenstein

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphql-frankenstein graphql-frankenstein

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).

Installation / Usage

graphql-frankenstein can be used as either a dependency in your Node project, or a standalone CLI app.

JavaScript

$ 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));

CLI

$ 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

License

MIT © John Flesch

About

Stitch together GraphQL fenced code blocks inside GitHub issues into an executable schema.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published