{"record":{"id":"b5833c469ebc09c8","repo":"hasura/graphql-engine","slug":"only-one-enumtypenames-can-be-defined-in-graphqlco","errorCode":null,"errorMessage":"only one enumTypeNames can be defined in GraphqlConfig, whose direction values are both 'asc' and 'desc'.","messagePattern":"only one enumTypeNames can be defined in GraphqlConfig, whose direction values are both 'asc' and 'desc'\\.","errorType":"validation","errorClass":"GraphqlConfigError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/graphql_config/error.rs","lineNumber":31,"sourceCode":"    )]\n    MissingLimitFieldInGraphqlConfig,\n    #[error(\n        \"the fieldName for offsetInput needs to be defined in GraphqlConfig, when models have a selectMany graphql API\"\n    )]\n    MissingOffsetFieldInGraphqlConfig,\n    #[error(\n        \"the filterInput needs to be defined in GraphqlConfig, when models have filterExpressionType\"\n    )]\n    MissingFilterInputFieldInGraphqlConfig,\n    #[error(\n        \"the orderByInput needs to be defined in GraphqlConfig, when models have orderByExpressionType\"\n    )]\n    MissingOrderByInputFieldInGraphqlConfig,\n    #[error(\n        \"the orderByInput.enumTypeNames needs to be defined in GraphqlConfig, when models have orderByExpressionType\"\n    )]\n    MissingOrderByEnumTypeNamesInGraphqlConfig,\n    #[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:}\")]","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/graphql_config/error.rs#L13-L49","documentation":"Raised when GraphqlConfig defines more than one entry in `orderByInput.enumTypeNames` that qualifies as the full asc/desc direction enum. Exactly one enumTypeNames entry covering both 'asc' and 'desc' is allowed; duplicates make the schema generation ambiguous. Thrown during the graphql_config resolution stage.","triggerScenarios":"GraphqlConfig.enumTypeNames contains two or more enum definitions whose direction values include both 'asc' and 'desc'; resolving metadata with any orderBy-capable model then fails.","commonSituations":"Merging orderBy configs from multiple sources (each contributing its own direction enum); copy-pasting enum entries; naming the same enum twice with different casing.","solutions":["Keep exactly one enumTypeNames entry whose directions map both 'asc' and 'desc', remove the rest","If you need multiple enum names, ensure only one carries both directions; partial-direction enums are not supported (see companion error)","Consolidate enum definitions during subgraph merges"],"exampleFix":"// before\n\"enumTypeNames\": [{\"name\": \"Dir\", \"directions\": {\"asc\": \"asc\", \"desc\": \"desc\"}}, {\"name\": \"Direction\", \"directions\": {\"asc\": \"ASC\", \"desc\": \"DESC\"}}]\n// after\n\"enumTypeNames\": [{\"name\": \"OrderDirection\", \"directions\": {\"asc\": \"asc\", \"desc\": \"desc\"}}]","handlingStrategy":"validation","validationCode":"let full_enums = order_by.enum_type_names.iter()\n    .filter(|e| e.directions.contains_key(\"asc\") && e.directions.contains_key(\"desc\"))\n    .count();\nassert!(full_enums <= 1, \"only one full asc/desc enumTypeNames allowed, found {}\", full_enums);","typeGuard":"fn single_full_direction_enum(order_by: &OrderByInput) -> bool {\n    order_by.enum_type_names.iter()\n        .filter(|e| e.directions.contains_key(\"asc\") && e.directions.contains_key(\"desc\"))\n        .count() <= 1\n}","tryCatchPattern":"Err(GraphqlConfigError::MultipleOrderByEnumTypeNamesInGraphqlConfig) => { /* keep one full-direction enum, drop the rest, re-resolve */ }","preventionTips":["Use exactly one direction enum in templates","Dedupe enums during metadata merges","Lint for duplicate enumTypeNames in CI"],"tags":["graphql","metadata","orderby","enum","duplicate"],"backgroundTag":"duplicate-config-definition","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}