hasura/graphql-engine · error

metadata is not consistent: {error}

Error message

metadata is not consistent: {error}

What it means

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.

Source

Thrown at v3/crates/graphql/schema/src/lib.rs:282

            mutation: Some(types::TypeId::MutationRoot {
                graphql_type_name: self.metadata.graphql_config.mutation_root_type_name.clone(),
            }),
            subscription: self
                .metadata
                .graphql_config
                .subscription_root_type_name
                .as_ref()
                .map(|type_name| types::TypeId::SubscriptionRoot {
                    graphql_type_name: type_name.clone(),
                }),
        }
    }
}

#[derive(Debug, thiserror::Error)]
#[allow(clippy::large_enum_variant)]
pub enum Error {
    #[error("metadata is not consistent: {error}")]
    ResolveError {
        #[from]
        error: metadata_resolve::WithContext<metadata_resolve::Error>,
    },
    #[error("internal error while building schema: {error}")]
    InternalBuildError {
        #[from]
        error: gql_schema::build::Error,
    },
    #[error("internal error: no support for: {summary}")]
    InternalUnsupported { summary: String },
    #[error("internal error while building schema, relationship not found: {relationship_name}")]
    InternalRelationshipNotFound { relationship_name: RelationshipName },
    #[error("internal error while building schema, type not found: {type_name}")]
    InternalTypeNotFound {
        type_name: Qualified<CustomTypeName>,
    },
    #[error(

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Inspect the {error} source chain (WithContext preserves the source with path context) to find the exact metadata path at fault
  2. Validate the metadata JSON/YAML against the schema for your Hasura/metadata version
  3. Fix the referenced inconsistent object (usually a dangling model/relationship/table reference)
  4. Re-apply or regenerate the metadata from the source of truth
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate metadata resolves cleanly before schema build if you have a resolve entry point
match metadata_resolve::resolve(metadata) { Err(e) => { /* report e with context before building schema */ } Ok(m) => build_schema(m) }

Try / catch

// Match Error::ResolveError { error } and walk error.source() chain (WithContext carries the metadata path) to locate the inconsistent node

Prevention

When it happens

Trigger: 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.

Common situations: Broken relationships in metadata (missing target model), inconsistent data source configurations, metadata exported from an incompatible Hasura version, partially applied metadata migrations.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/a6393714a384daee. Report an issue: GitHub.