hasura/graphql-engine · error · GraphqlConfigError

multiple graphql types found with the same name: {graphql_ty

Error message

multiple graphql types found with the same name: {graphql_type_name:}

What it means

The graphql_config stage collects GraphQL type names across all models and throws this when two distinct resolved GraphQL types end up with the same name. Since GraphQL schemas cannot contain duplicate type names, metadata resolution fails with the conflicting type name in the message.

Source

Thrown at v3/crates/metadata-resolve/src/stages/graphql_config/error.rs:49

    #[error(
        "only one enumTypeNames can be defined in GraphqlConfig, whose direction values are both 'asc' and 'desc'."
    )]
    MultipleOrderByEnumTypeNamesInGraphqlConfig,
    #[error(
        "invalid directions: {directions} defined in orderByInput of GraphqlConfig , currently there is no support for partial directions. Please specify a type which has both 'asc' and 'desc' directions"
    )]
    InvalidOrderByDirection { directions: String },
    #[error(
        "the fieldName for argumentsInput needs to be defined in GraphqlConfig, when models have argumentsInputType"
    )]
    MissingArgumentsInputFieldInGraphqlConfig,
    #[error(
        "the filterInputFieldName for aggregate needs to be defined in GraphqlConfig, when models have a selectAggregate graphql API"
    )]
    MissingAggregateFilterInputFieldNameInGraphqlConfig,
    #[error("\"{name:}\" is not a valid GraphQL name.")]
    InvalidGraphQlName { name: String },
    #[error("multiple graphql types found with the same name: {graphql_type_name:}")]
    ConflictingGraphQlType { graphql_type_name: ast::TypeName },
}

impl ContextualError for GraphqlConfigError {
    fn create_error_context(&self) -> Option<error_context::Context> {
        None
    }
}

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Rename one of the conflicting models/types so each resolves to a unique GraphQL type name
  2. Check the error context for which two metadata objects produce the colliding type name {graphql_type_name}
  3. If merging subgraphs, ensure model names or type name prefixes are namespaced per subgraph

Example fix

# before
# models/user.yaml
name: user
# models/admin-user.yaml
name: user  # duplicate

# after
# models/admin-user.yaml
name: adminUser
Defensive patterns

Strategy: validation

Validate before calling

names = [m['definition']['name'] for m in all_model_metadata]
dupes = {n for n in names if names.count(n) > 1}
assert not dupes, f'duplicate model/type names: {dupes}'

Prevention

When it happens

Trigger: Two models in the same subgraph configured with the same GraphQL type name, or two models targeting the same underlying object type but generating differently-shaped type wrappers that collapse to one name (e.g. two models named the same in different namespaces without distinct type prefixes).

Common situations: Copy-pasting a model definition and forgetting to change the name; consolidating subgraphs where models collide; customizing type names in GraphqlConfig so they overlap.

Related errors


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