{"record":{"id":"a6393714a384daee","repo":"hasura/graphql-engine","slug":"metadata-is-not-consistent-error","errorCode":null,"errorMessage":"metadata is not consistent: {error}","messagePattern":"metadata is not consistent: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/crates/graphql/schema/src/lib.rs","lineNumber":282,"sourceCode":"            mutation: Some(types::TypeId::MutationRoot {\n                graphql_type_name: self.metadata.graphql_config.mutation_root_type_name.clone(),\n            }),\n            subscription: self\n                .metadata\n                .graphql_config\n                .subscription_root_type_name\n                .as_ref()\n                .map(|type_name| types::TypeId::SubscriptionRoot {\n                    graphql_type_name: type_name.clone(),\n                }),\n        }\n    }\n}\n\n#[derive(Debug, thiserror::Error)]\n#[allow(clippy::large_enum_variant)]\npub enum Error {\n    #[error(\"metadata is not consistent: {error}\")]\n    ResolveError {\n        #[from]\n        error: metadata_resolve::WithContext<metadata_resolve::Error>,\n    },\n    #[error(\"internal error while building schema: {error}\")]\n    InternalBuildError {\n        #[from]\n        error: gql_schema::build::Error,\n    },\n    #[error(\"internal error: no support for: {summary}\")]\n    InternalUnsupported { summary: String },\n    #[error(\"internal error while building schema, relationship not found: {relationship_name}\")]\n    InternalRelationshipNotFound { relationship_name: RelationshipName },\n    #[error(\"internal error while building schema, type not found: {type_name}\")]\n    InternalTypeNotFound {\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/graphql/schema/src/lib.rs#L264-L300","documentation":"Error from the schema-building crate (graphql/schema) when resolving NDC metadata fails: the metadata_resolve stage reported an inconsistency in the attached metadata (WithContext wraps the underlying error with a source chain). It means the Hasura-style metadata used to generate the GraphQL schema is internally inconsistent or unresolvable.","triggerScenarios":"Calling schema construction (e.g. build_schema) with metadata whose native data connector / model / relationship entries reference objects that don't exist or have conflicting definitions.","commonSituations":"Broken relationships in metadata (missing target model), inconsistent data source configurations, metadata exported from an incompatible Hasura version, partially applied metadata migrations.","solutions":["Inspect the {error} source chain (WithContext preserves the source with path context) to find the exact metadata path at fault","Validate the metadata JSON/YAML against the schema for your Hasura/metadata version","Fix the referenced inconsistent object (usually a dangling model/relationship/table reference)","Re-apply or regenerate the metadata from the source of truth"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Validate metadata resolves cleanly before schema build if you have a resolve entry point\nmatch metadata_resolve::resolve(metadata) { Err(e) => { /* report e with context before building schema */ } Ok(m) => build_schema(m) }","typeGuard":null,"tryCatchPattern":"// Match Error::ResolveError { error } and walk error.source() chain (WithContext carries the metadata path) to locate the inconsistent node","preventionTips":["Keep metadata under version control and validate on apply","Upgrade metadata and engine together"],"tags":["metadata","schema-generation","hasura","ndc"],"backgroundTag":"metadata-inconsistent-schema-build-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}