0.1.2 • Published 6 years ago

@coralproject/gql-merge v0.1.2

Weekly downloads
116
License
MIT
Repository
github
Last release
6 years ago

gql-merge

Tools for merging GraphQL documents

Background

This repo contains tools for merging definitions into multiple GraphQL documents into one. For example, say you have these two files GraphQL files:

type Post {
  id: ID!
  content: String
}

type Query {
  postById(id: ID!): Post
}
type Author {
  id: ID!
  name: String
}

type Query {
  postsByAuthorId(id: ID!): [Post]
}

You can use the gql-merge tool to combine these files into one:

The resulting file would look like this:

type Post {
  id: ID!
  content: String
}

type Query {
  postById(id: ID!): Post
  postsByAuthorId(id: ID!): [Post]
}

type Author {
  id: ID!
  name: String
}

Installation

$ yarn add @coralproject/gql-merge