cultofcoders:graphql-loader

v0.0.1Published 7 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Meteor GraphQL Loader

Mission Make GraphQL easy to spread out around the app, so you can focus on propper concern separation.

Install

meteor add cultofcoders:graphql-loader

Usage

Simply merges types and resolvers, so you can have them split around your custom folder architecture. You can decide to import and load them all in one place, or around the apps.

1import { getSchema, load } from 'meteor/cultofcoders:graphql-loader';
2
3// spread around your app
4load({
5  typeDefs?: String | Array<String>,
6  resolvers?: Object | Array<Object>
7})
8
9// load also accepts array
10load([
11  {...},
12  {...}
13])
1// done near where you create the graphql loader
2import { makeExecutableSchema } from 'graphql-tools';
3const { typeDefs, resolvers } = getSchema();
4
5const schema = makeExecutableSchema({
6  typeDefs,
7  resolvers
8});

Using: https://github.com/okgrow/merge-graphql-schemas