Open
Description
The validateName
function that is used to validate lots of schema parts is currently only checking that names are not reserved:
graphql-js/src/type/validate.ts
Lines 206 to 217 in 6b253e7
It should also check that the
name
complies with https://spec.graphql.org/October2021/#Name, e.g. by testing against the regex /^(?!__)[A-Za-z_][A-Za-z0-9_]*$/
.Otherwise it's possible to construct schemas (via the constructor, not by parsing) that upon printing would lead to invalid syntax, or fields which could never be queried.
Metadata
Metadata
Assignees
Labels
No labels