{"id":47834,"library":"graphql-combine","title":"graphql-combine","description":"graphql-combine v1.0.1 is a utility for modularizing GraphQL schemas and resolvers by reading files from the filesystem. It uses glob patterns to collect schema.graphql and resolver.js files, merging them into a single typeDefs and resolvers object for Apollo Server or similar. Unlike graphql-tools' mergeFiles or manual concatenation, it provides a simple file-based convention. The package has had no updates since 2019 and relies on glob and merge-graphql-schemas. It is suitable for small to medium projects but lacks active maintenance.","status":"maintenance","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/neist/graphql-combine","tags":["javascript","graphql","schema","merge","combine","appolo","graphql-tools"],"install":[{"cmd":"npm install graphql-combine","lang":"bash","label":"npm"},{"cmd":"yarn add graphql-combine","lang":"bash","label":"yarn"},{"cmd":"pnpm add graphql-combine","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used to match resolver and typeDef file paths","package":"glob","optional":false},{"reason":"Used to merge the type definitions and resolvers","package":"merge-graphql-schemas","optional":false}],"imports":[{"note":"Default import only; package is ESM-only (no CommonJS export).","wrong":"const combine = require('graphql-combine')","symbol":"combine","correct":"import combine from 'graphql-combine'"},{"note":"Package does not ship TypeScript definitions; types are inferred.","wrong":"No separate type import available; types are not exported.","symbol":"typeof combine","correct":"import type { CombineOptions, CombineResult } from 'graphql-combine'"},{"note":"combine is a default export, not named. Named import will result in undefined.","wrong":"import { combine } from 'graphql-combine'","symbol":"combine (nested)","correct":"import combine from 'graphql-combine'"}],"quickstart":{"code":"import { ApolloServer } from 'apollo-server';\nimport combine from 'graphql-combine';\nimport path from 'path';\n\nconst { typeDefs, resolvers } = combine({\n  typeDefs: path.join(__dirname, 'graphql/*/schema.graphql'),\n  resolvers: path.join(__dirname, 'graphql/*/resolver.js')\n});\n\nconst server = new ApolloServer({ typeDefs, resolvers });\nserver.listen().then(({ url }) => console.log(`Server ready at ${url}`));","lang":"javascript","description":"Combine schema.graphql and resolver.js files from multiple directories into one Apollo Server instance."},"warnings":[{"fix":"Use dynamic import() or switch to ESM project (type: 'module' in package.json).","message":"The package is ESM-only and will throw an error if used with require() in CommonJS environments.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure each resolver file has export default { ... }.","message":"Resolvers must export default a plain object; combine() does not handle named exports or resolver arrays.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure resolver keys (e.g., Query, Mutation) are unique across files or wrap in separate namespaces.","message":"Combined resolvers deeply merge; overlapping keys in resolvers from different files may cause unexpected overrides.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider migrating to graphql-tools' mergeResolvers and mergeTypeDefs from @graphql-tools/merge.","message":"The package depends on merge-graphql-schemas (v1). This library is now deprecated and unmaintained.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'2019':70 'activ':90 'apollo':43 'appolo':97 'base':61 'collect':28 'combin':3,6,96 'concaten':54 'convent':62 'file':19,32,60 'file-bas':59 'filesystem':22 'glob':25,74 'graphql':2,5,13,49,78,93,99 'graphql-combin':1,4 'graphql-tool':48,98 'javascript':92 'lack':89 'mainten':91 'manual':53 'medium':86 'merg':33,77,95 'merge-graphql-schema':76 'mergefil':51 'modular':12 'object':41 'packag':64 'pattern':26 'project':87 'provid':56 'read':18 'reli':72 'resolv':16,40 'resolver.js':31 'schema':14,79,94 'schema.graphql':29 'server':44 'similar':46 'simpl':58 'sinc':69 'singl':37 'small':84 'suitabl':82 'tool':50,100 'typedef':38 'unlik':47 'updat':68 'use':24 'util':10 'v1.0.1':7","created_at":"2026-06-07T16:53:33.770640+00:00","updated_at":"2026-06-07T16:53:33.770640+00:00","problems":[{"fix":"Change import { combine } from 'graphql-combine' to import combine from 'graphql-combine'.","cause":"Importing combine as a named import instead of default import.","error":"TypeError: combine is not a function"},{"fix":"Run npm install graphql-combine and ensure it is in node_modules.","cause":"Package not installed or path issue in ESM.","error":"Error: Cannot find module 'graphql-combine'"},{"fix":"Use dynamic import() or set project to type: 'module' in package.json.","cause":"Using require() on an ESM-only package in a CommonJS file.","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/neist/graphql-combine/","github":"https://github.com/neist/graphql-combine","docs":null,"changelog":null,"pypi":null,"npm":"graphql-combine","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}