Skip to content

Instantly share code, notes, and snippets.

@nayaabkhan
Created October 15, 2019 07:02
Show Gist options
  • Select an option

  • Save nayaabkhan/2a7ffc655b630bd6d38d2255401e758e to your computer and use it in GitHub Desktop.

Select an option

Save nayaabkhan/2a7ffc655b630bd6d38d2255401e758e to your computer and use it in GitHub Desktop.
Merge GraphQL Modules
import { fileLoader, mergeResolvers, mergeTypes } from 'merge-graphql-schemas'
import * as path from 'path'
const schemaFiles = fileLoader(path.join(__dirname, './**/*.graphql'))
const resolverFiles = fileLoader(path.join(__dirname, './**/resolvers.ts'))
const typeDefs = mergeTypes(schemaFiles, { all: true })
const resolvers = mergeResolvers(resolverFiles)
export { typeDefs, resolvers }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment