MCPcopy
hub / github.com/ardatan/graphql-tools / handleModule

Function handleModule

packages/node-require/src/index.ts:13–21  ·  view source on GitHub ↗
(m: NodeModule, filename: string)

Source from the content-addressed store, hash-verified

11const VALID_EXTENSIONS = ['graphql', 'graphqls', 'gql', 'gqls'];
12
13export function handleModule(m: NodeModule, filename: string) {
14 const sources = loadTypedefsSync(filename, {
15 loaders: [new GraphQLFileLoader()],
16 });
17
18 const documents = sources.map(source => source.document).filter(isSome);
19 const mergedDoc = concatAST(documents);
20 m.exports = mergedDoc;
21}
22
23export function registerGraphQLExtensions(nodeRequire: NodeRequire) {
24 for (const ext of VALID_EXTENSIONS) {

Callers 1

Calls 2

loadTypedefsSyncFunction · 0.90
filterMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…