{"record":{"id":"75289012416cf15a","repo":"hasura/graphql-engine","slug":"multiple-graphql-types-found-with-the-same-name","errorCode":null,"errorMessage":"multiple graphql types found with the same name: {graphql_type_name:}","messagePattern":"multiple graphql types found with the same name: (.+?)","errorType":"validation","errorClass":"GraphqlConfigError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/graphql_config/error.rs","lineNumber":49,"sourceCode":"    #[error(\n        \"only one enumTypeNames can be defined in GraphqlConfig, whose direction values are both 'asc' and 'desc'.\"\n    )]\n    MultipleOrderByEnumTypeNamesInGraphqlConfig,\n    #[error(\n        \"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\"\n    )]\n    InvalidOrderByDirection { directions: String },\n    #[error(\n        \"the fieldName for argumentsInput needs to be defined in GraphqlConfig, when models have argumentsInputType\"\n    )]\n    MissingArgumentsInputFieldInGraphqlConfig,\n    #[error(\n        \"the filterInputFieldName for aggregate needs to be defined in GraphqlConfig, when models have a selectAggregate graphql API\"\n    )]\n    MissingAggregateFilterInputFieldNameInGraphqlConfig,\n    #[error(\"\\\"{name:}\\\" is not a valid GraphQL name.\")]\n    InvalidGraphQlName { name: String },\n    #[error(\"multiple graphql types found with the same name: {graphql_type_name:}\")]\n    ConflictingGraphQlType { graphql_type_name: ast::TypeName },\n}\n\nimpl ContextualError for GraphqlConfigError {\n    fn create_error_context(&self) -> Option<error_context::Context> {\n        None\n    }\n}\n","sourceCodeStart":31,"sourceCodeEnd":58,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/graphql_config/error.rs#L31-L58","documentation":"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.","triggerScenarios":"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).","commonSituations":"Copy-pasting a model definition and forgetting to change the name; consolidating subgraphs where models collide; customizing type names in GraphqlConfig so they overlap.","solutions":["Rename one of the conflicting models/types so each resolves to a unique GraphQL type name","Check the error context for which two metadata objects produce the colliding type name {graphql_type_name}","If merging subgraphs, ensure model names or type name prefixes are namespaced per subgraph"],"exampleFix":"# before\n# models/user.yaml\nname: user\n# models/admin-user.yaml\nname: user  # duplicate\n\n# after\n# models/admin-user.yaml\nname: adminUser","handlingStrategy":"validation","validationCode":"names = [m['definition']['name'] for m in all_model_metadata]\ndupes = {n for n in names if names.count(n) > 1}\nassert not dupes, f'duplicate model/type names: {dupes}'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Namespace model names per subgraph before merging","Fail fast in CI on duplicate names across the combined metadata"],"tags":["hasura","ddn","graphql","schema","duplicate-types"],"backgroundTag":"graphql-schema-type-conflict","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}