{"record":{"id":"30fd65df5cb466b2","repo":"hasura/graphql-engine","slug":"invalid-directions-directions-defined-in-orderb","errorCode":null,"errorMessage":"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","messagePattern":"invalid 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","errorType":"validation","errorClass":"GraphqlConfigError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/graphql_config/error.rs","lineNumber":36,"sourceCode":"    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:}\")]\n    ConflictingGraphQlType { graphql_type_name: ast::TypeName },\n}\n\nimpl ContextualError for GraphqlConfigError {\n    fn create_error_context(&self) -> Option<error_context::Context> {","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/graphql_config/error.rs#L18-L54","documentation":"Raised when an enumTypeNames entry in GraphqlConfig.orderByInput defines only a subset of directions (only 'asc' or only 'desc') instead of both. Partial direction enums are unsupported because every orderBy input needs both sort directions. The message interpolates the offending {directions}.","triggerScenarios":"GraphqlConfig.orderByInput.enumTypeNames contains an entry whose `directions` map lacks either 'asc' or 'desc'; resolution of metadata with orderBy models fails with the invalid directions listed.","commonSituations":"Hand-writing a direction enum and forgetting one member; mapping both directions to the same value; copying an enum from another schema that only sorts ascending; casing mistakes that make a direction unrecognizable.","solutions":["Set the entry's directions to include both keys, e.g. {\"asc\": \"asc\", \"desc\": \"desc\"} (values may be customized, keys must be both present)","Check for typos/casing in the direction keys — they must be exactly 'asc' and 'desc'","If you intended a one-way sort, note it is unsupported; use a full asc/desc enum"],"exampleFix":"// before\n\"enumTypeNames\": [{\"name\": \"SortDir\", \"directions\": {\"asc\": \"asc\"}}]\n// after\n\"enumTypeNames\": [{\"name\": \"SortDir\", \"directions\": {\"asc\": \"asc\", \"desc\": \"desc\"}}]","handlingStrategy":"validation","validationCode":"for e in &order_by.enum_type_names {\n    assert!(e.directions.contains_key(\"asc\") && e.directions.contains_key(\"desc\"),\n        \"enum {} must define both asc and desc, got: {:?}\", e.name, e.directions);\n}","typeGuard":"fn directions_complete(e: &EnumTypeName) -> bool {\n    e.directions.contains_key(\"asc\") && e.directions.contains_key(\"desc\")\n}","tryCatchPattern":"Err(GraphqlConfigError::InvalidOrderByDirection { directions }) => { /* log directions, fix enum to include both asc and desc, re-resolve */ }","preventionTips":["Always define both 'asc' and 'desc' keys in direction enums","Check for typos/casing in direction keys","Use a JSON schema to constrain the directions map"],"tags":["graphql","metadata","orderby","enum","directions","validation"],"backgroundTag":"invalid-enum-directions","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}