isValidNameError removed in graphql 17.0.2
In our sandbox runs up to 2026-10-28, gemini-3.8-flash wrote const { isValidNameError } = require('graphql'); for graphql. It fails on 17.0.2 with TypeError (changed between 16.13.2 and 17.0.2). Use const { assertName } = require('graphql'); instead.
- What to do
- replace the line
- Output
- same on one example
- Patch
- fails when applied word for word
- Auto-apply
- not allowed
- Seen in
- 1 model
- Worked / failed
- 1 / 0
- Last verified
- 2026-10-28
What to do
Not for automatic application — the patched example does not run on 17.0.2: exit code 1, ReferenceError: isValidNameError is not defined. Show this correction to the user as a lead. Replace the old line with the new one; the rest of the code can stay.
Automatic application: not allowed — the patch gives fails when applied word for word. Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own. The change itself is described by kind (removed); the checks are in proof; neither follows from the other.
How to tell this applies to your code
- graphql 17.0.2 is installed: checked there, still a lead. A newer release may need the same change but was not checked, so there it is a lead; on 16.13.2 or older the old code works (changed between 16.13.2 and 17.0.2).
- Your code uses:
isValidNameError - Or it already failed with:
TypeError: isValidNameError is not a function(every correction for this error)
Old and new code
const { isValidNameError } = require('graphql');const { assertName } = require('graphql');
Error on 17.0.2:
TypeError: isValidNameError is not a function
| Script | graphql version | Result |
|---|---|---|
| Code the models wrote | 16.13.2 | works |
| Code the models wrote | 17.0.2 | fails: TypeError |
| Verified example below | 17.0.2 | works |
| Output of the verified example | 17.0.2 | same as the original's on 16.13.2 (observed stdout of one example; not a proof of equivalent behaviour) |
| Patch applied word for word to the example | 17.0.2 | applied word for word, the patch does not give the verified example's result — the patched example does not run on 17.0.2: exit code 1, ReferenceError: isValidNameError is not defined |
Verified example for graphql 17.0.2
const { assertName } = require('graphql');
function isValidNameError(name) {
if (name.length > 1 && name[0] === '_' && name[1] === '_') {
return new Error(
`Name "${name}" must not begin with "__", which is reserved by GraphQL introspection.`,
);
}
try {
assertName(name);
} catch (error) {
return error;
}
}
const proposedNames = [
'User',
'2fast',
'__secret',
'Order_Item',
'bad-name',
];
for (const name of proposedNames) {
const error = isValidNameError(name);
if (error) {
console.log(`${name}: invalid: ${error.message}`);
} else {
console.log(`${name}: valid`);
}
}Source
Remove deprecated `assertValidName` & `isValidNameError`
Release notes · Seen in: gemini-3.8-flash · First seen 2026-10-28 · Last verified 2026-10-28 · All corrections for graphql
For agents
- This page as JSON:
https://formachines.ai/errata/npm/graphql/0002-isvalidnameerror/index.json - Whole database in plain text:
/errata/llms-full.txt - Install the skill:
npx skills add formachines-ai/skills@model-errata(source on GitHub) - Command line:
npx @formachines/errata checkreads your lockfiles (npm) - MCP server:
claude mcp add errata -- npx -y @formachines/errata-mcp; registry nameai.formachines/errata(npm) - Confirm, dispute or add a correction: feedback form and API
- Apply a correction on your own only when the installed version is one it was checked on (
versions.checked_on:versions.fails_onand every recheck) and itsproof.auto_applyis true (proof.equivalentis true andproof.applicability.statusis applies). On a newer version than those checked, a version betweenversions.works_onandversions.fails_on, or an unknown version, show it to the user as a lead and do not apply it; onversions.works_onor older it does not apply.