NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
npm, #2882 most downloaded on npm
A set of utils for faster development of GraphQL tools
Latest stable
9.1.3
Last release 12 days ago
10 Nov 2026
Ships fairly regularly
a new release about every 9 days
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
1923 releases · first in 2020
Drag across the ruler to compare, or tap a release to open it.
Updated dependencies [`77d599f`]:
77d599f]:
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
@graphql-tools/load@9.1.2
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Updated dependencies [`cc144f6`, `03f8963`]:
Nothing published for this version
Nothing published for this version
Nothing published for this version
A pointer such as src//*.{ts,tsx} calls the custom loader once. Returning a single combined document kept every operation on that one pointer. Returni
#8603 62ef681 Thanks @ardatan! - Custom loaders on loadDocuments / loadDocumentsSync / loadSchema can now return an array. Each item is added as its own source.
A pointer such as src/**/*.{ts,tsx} calls the custom loader once. Returning a single combined document kept every operation on that one pointer. Returning an array was ignored, so the load failed with Couldn't find any GraphQL type definitions.
// custom-loader.js
const { parse } = require('graphql');
module.exports = function () {
return [
{
document: parse(/* GraphQL */ `
query Users {
users {
id
}
}
`),
location: 'users.graphql',
},
{
document: parse(/* GraphQL */ `
query Orders {
orders {
id
}
}
`),
location: 'orders.graphql',
},
];
};
loadDocuments(
{
'src/**/*.{ts,tsx}': {
loader: './custom-loader.js',
},
},
{ loaders: [] },
);
The result is two sources: Users at users.graphql and Orders at orders.graphql. A single DocumentNode or { document } return value still becomes one source. An array of DocumentNodes uses the pointer as each item's location.
#8606 6da2904 Thanks @ardatan! - loadDocuments / loadTypedefs now accept errorHandling so 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 Error and drop every other file:
# valid.query.graphql
query ValidQuery {
a
}
# broken-a.query.graphql
query {
a
await loadDocuments('**/*.query.graphql', {
loaders: [new GraphQLFileLoader()],
});
// throws Syntax Error
errorHandling chooses what happens next. The default is unchanged (throw the first error).
aggregate waits until every source is attempted, then throws AggregateError with each parse/load failure:
await loadDocuments('**/*.query.graphql', {
loaders: [new GraphQLFileLoader()],
errorHandling: 'aggregate',
});
return does not throw. Failed sources stay in the result as { location, error } without a document, 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 Error
Source now has an optional error field. @graphql-tools/graphql-file-loader and @graphql-tools/code-file-loader honor the same option. CodeFileLoader's existing noSilentErrors default is unchanged unless errorHandling is set.
Custom loader failures and incomplete inline documents (query Foo {) follow the same option. errorHandling: 'throw' raises the first failure, not AggregateError.
#8602 46039a0 Thanks @ardatan! - loadSchema and loadSchemaSync already accept sort: true. That always runs GraphQL's lexicographicSortSchema, which reorders the type list and also reorders fields, arguments, and enum values.
A schema that was written with a meaningful enum or field order cannot keep that order after load:
# loaded schema
enum DayOfWeek {
SUNDAY
MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
}
type Query {
d: String
z: String
a: String
day: DayOfWeek
}
type User {
aa: String
a: String
}
type A {
s: String
b: String
}
# sort: true (current default)
type A {
b: String
s: String
}
enum DayOfWeek {
FRIDAY
MONDAY
SATURDAY
SUNDAY
THURSDAY
TUESDAY
WEDNESDAY
}
type Query {
a: String
d: String
day: DayOfWeek
z: String
}
type User {
a: String
aa: String
}
This release adds sortMode on LoadSchemaOptions.
sort: true with no sortMode, or sortMode: 'lexicographic', keeps the current behavior.sort: true, sortMode: 'typesOnly' sorts only the type list. Field and enum value order stay as they were loaded. If the same type is split across files, those members keep merge order instead of being sorted.sort: false (or omitted) ignores sortMode.loadSchema('schema.graphql', {
loaders: [new GraphQLFileLoader()],
sort: true,
sortMode: 'typesOnly',
});
# sort: true, sortMode: 'typesOnly'
type A {
s: String
b: String
}
enum DayOfWeek {
SUNDAY
MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
}
type Query {
d: String
z: String
a: String
day: DayOfWeek
}
type User {
aa: String
a: String
}
#8604 9df67b4 Thanks @ardatan! - useCustomLoader and useCustomLoaderSync now include the original load failure in the thrown error message.
A missing, broken, or non-function custom loader used to throw only:
Failed to load custom loader: ./codegen-loader.js
The underlying SyntaxError, Cannot find module, or "did not export a function" was swallowed, so codegen and loadDocuments could not show why the file failed.
// broken-loader.js
module.exports = function ( {
await useCustomLoader('./broken-loader.js', cwd);
Failed to load custom loader: ./broken-loader.js
SyntaxError: Unexpected token '{'
getCustomLoaderByPath still returns null when the file cannot be loaded.
Updated dependencies [6da2904, 902d870, 7770067, f956bfe]:
One column per quarter.