{"record":{"id":"da3f3d132895ec78","repo":"hasura/graphql-engine","slug":"the-filterinput-needs-to-be-defined-in-graphqlconf","errorCode":null,"errorMessage":"the filterInput needs to be defined in GraphqlConfig, when models have filterExpressionType","messagePattern":"the filterInput needs to be defined in GraphqlConfig, when models have filterExpressionType","errorType":"validation","errorClass":"GraphqlConfigError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/graphql_config/error.rs","lineNumber":19,"sourceCode":"use graphql_types as ast;\n\nuse crate::types::error::ContextualError;\n\n#[derive(Debug, thiserror::Error)]\npub enum GraphqlConfigError {\n    #[error(\"graphql configuration is not defined in supergraph\")]\n    MissingGraphqlConfig,\n    #[error(\"graphql configuration should be defined only once in supergraph\")]\n    MultipleGraphqlConfigDefinition,\n    #[error(\n        \"the fieldName for limitInput needs to be defined in GraphqlConfig, when models have a selectMany graphql API\"\n    )]\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    )]","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/graphql_config/error.rs#L1-L37","documentation":"Raised when any model in the supergraph declares a `filterExpressionType` (i.e. supports filter expressions) but the GraphqlConfig does not define `filterInput`. The filter input object name must be configured before filters can be wired into the GraphQL schema. Thrown by the graphql_config resolution stage.","triggerScenarios":"Metadata has a model with filterExpressionType set while GraphqlConfig lacks the `filterInput` definition; running metadata resolution/validation fails with this error.","commonSituations":"Adding filter support to an existing model without extending the graphql config; upgrading to a version that enforces filterInput presence; template metadata that only configures pagination fields.","solutions":["Add `filterInput: {fieldName: \"where\"}` (or your naming convention) to GraphqlConfig","Verify every model that uses filterExpressionType is covered by the single shared config","Regenerate metadata with tooling that emits filterInput when filters are used"],"exampleFix":"// before\n{\"graphql\": {\"limitInput\": {\"fieldName\": \"limit\"}}, \"models\": [{\"filterExpressionType\": \"users_filter\"}]}\n// after\n{\"graphql\": {\"filterInput\": {\"fieldName\": \"where\"}, \"limitInput\": {\"fieldName\": \"limit\"}}, \"models\": [{\"filterExpressionType\": \"users_filter\"}]}","handlingStrategy":"validation","validationCode":"let uses_filter = models.iter().any(|m| m.filter_expression_type.is_some());\nif uses_filter {\n    assert!(config.filter_input.as_ref().is_some_and(|f| f.field_name.is_some()));\n}","typeGuard":"fn filter_ok(config: &GraphqlConfig, models: &[Model]) -> bool {\n    !models.iter().any(|m| m.filter_expression_type.is_some())\n        || config.filter_input.as_ref().is_some_and(|f| f.field_name.is_some())\n}","tryCatchPattern":"Err(GraphqlConfigError::MissingFilterInputFieldInGraphqlConfig) => { /* add filterInput.fieldName and re-resolve */ }","preventionTips":["Add filterInput whenever introducing filterExpressionType","Keep a checklist of model features vs required config fields","Validate metadata in CI"],"tags":["graphql","metadata","filter","validation"],"backgroundTag":"missing-graphql-config-field","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}