@graphql-tools/code-file-loader
9.1.2 · 10 Nov 2026MIT13.2M / weekRepositoryHomepagenpmAtom feed
9.1.2 is the newest release of 9.x.
In short
1 new4 internal
Release note
The section about @graphql-tools/code-file-loader of a note shared by several packages.
@graphql-tools/code-file-loader@9.1.0
Minor Changes
loadDocuments/loadTypedefsnow accepterrorHandlingso a single invalid file does not have to hide the rest of the load.A glob that mixes a valid operation with broken SDL used to throw the first
Syntax Errorand drop every other file:# valid.query.graphql query ValidQuery { a }# broken-a.query.graphql query { aawait loadDocuments('**/*.query.graphql', { loaders: [new GraphQLFileLoader()], }); // throws Syntax ErrorerrorHandlingchooses what happens next. The default is unchanged (throwthe first error).aggregatewaits until every source is attempted, then throwsAggregateErrorwith each parse/load failure:await loadDocuments('**/*.query.graphql', { loaders: [new GraphQLFileLoader()], errorHandling: 'aggregate', });returndoes not throw. Failed sources stay in the result as{ location, error }without adocument, next to the sources that parsed:const sources = await loadDocuments('**/*.query.graphql', { loaders: [new GraphQLFileLoader(), new CodeFileLoader()], errorHandling: 'return', }); sources[0].document; // ValidQuery sources[1].document; // undefined sources[1].error; // GraphQLError: Syntax ErrorSourcenow has an optionalerrorfield.@graphql-tools/graphql-file-loaderand@graphql-tools/code-file-loaderhonor the same option.CodeFileLoader's existingnoSilentErrorsdefault is unchanged unlesserrorHandlingis set.Custom loader failures and incomplete inline documents (
query Foo {) follow the same option.errorHandling: 'throw'raises the first failure, notAggregateError.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.