{"record":{"id":"2ab8137b4dba7194","repo":"hasura/graphql-engine","slug":"invalid-graphql-name-0","errorCode":null,"errorMessage":"invalid graphql name: {0}","messagePattern":"invalid graphql name: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/crates/graphql/lang-graphql/src/introspection.rs","lineNumber":19,"sourceCode":"// pub mod schema;\n\nuse std::collections::HashSet;\n\nuse crate::ast::common as ast;\nuse crate::ast::common::TypeName;\nuse crate::mk_name;\nuse crate::normalized_ast as normalized;\nuse crate::schema;\nuse crate::schema::RegisteredTypeName;\n\nuse indexmap::IndexMap;\nuse serde_json as json;\n\n#[derive(Debug, thiserror::Error)]\npub enum Error {\n    #[error(\"internal introspection error: normalized introspection ast not as expected: {0}\")]\n    InternalNormalizationError(normalized::Error),\n    #[error(\"invalid graphql name: {0}\")]\n    InvalidGraphQlName(String),\n    #[error(\"internal introspection error: {0}\")]\n    Internal(String),\n}\n\nimpl From<ast::InvalidGraphQlName> for Error {\n    fn from(error: ast::InvalidGraphQlName) -> Self {\n        Error::InvalidGraphQlName(error.0)\n    }\n}\n\nimpl From<normalized::Error> for Error {\n    fn from(error: normalized::Error) -> Self {\n        Error::InternalNormalizationError(error)\n    }\n}\n\nimpl From<json::Error> for Error {","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/graphql/lang-graphql/src/introspection.rs#L1-L37","documentation":"A GraphQL name (type, field, argument name) failed validation against the GraphQL name grammar during introspection. GraphQL names must match /[_A-Za-z][_0-9A-Za-z]*/; anything else is rejected when converting to an ast name.","triggerScenarios":"Metadata defining a type/field whose name starts with a digit or contains invalid characters (spaces, dashes, unicode); database identifiers with illegal characters exposed to GraphQL without sanitization; custom directives/annotations producing invalid names.","commonSituations":"Tables or columns with hyphens or leading digits mapped directly to GraphQL; hand-written metadata with typo'd names; converting external schemas without name sanitization.","solutions":["Rename the entity or add an explicit GraphQL-safe name mapping in metadata","Sanitize generated names (e.g. camelCase, prefix digits with a letter/underscore)","Validate names against the GraphQL grammar before applying metadata"],"exampleFix":"# before\ntype 1album { ... }   # metadata with invalid name\n# after\ntype album1 { ... }","handlingStrategy":"validation","validationCode":"// GraphQL name grammar check before applying metadata\nconst NAME = /^[_A-Za-z][_0-9A-Za-z]*$/;\nif (!NAME.test(fieldName)) throw new Error('invalid GraphQL name');","typeGuard":"const isValidGraphqlName = (s) => /^[_A-Za-z][_0-9A-Za-z]*$/.test(s);","tryCatchPattern":"// Catch, sanitize the offending name, and re-apply metadata","preventionTips":["Map hyphenated/digit-leading identifiers to safe GraphQL names","Lint metadata names before apply"],"tags":["graphql","name-validation","introspection"],"backgroundTag":"invalid-graphql-name","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}