Skip to content

Instantly share code, notes, and snippets.

@mlg87
Created July 21, 2020 21:09
Show Gist options
  • Save mlg87/209d38f692b26097183afb94a3f83467 to your computer and use it in GitHub Desktop.
Save mlg87/209d38f692b26097183afb94a3f83467 to your computer and use it in GitHub Desktop.
Using Apollo Client for global state management code samples - localSchema.js
// ./localSchema.js
const { loadFilesSync } = require("@graphql-tools/load-files");
const { mergeTypeDefs } = require("@graphql-tools/merge");
const loadedFiles = loadFilesSync(`${__dirname}/src/**/schema.js`);
module.exports.schema = mergeTypeDefs(loadedFiles);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment