hasura/graphql-engine · warning · ModelGraphqlIssue

the model {model_name} has defined a selectAggregate graphql

Error message

the model {model_name} has defined a selectAggregate graphql API, but it will not appear in the GraphQL API unless query.aggregate.filterInputFieldName is also configured in GraphqlConfig

What it means

A model declares a selectAggregate GraphQL API, but query.aggregate.filterInputFieldName is not configured in GraphqlConfig, so the aggregate API silently won't appear in the GraphQL schema. This is an issue/warning, not a hard failure.

Source

Thrown at v3/crates/metadata-resolve/src/stages/models_graphql/types.rs:137

pub struct OffsetFieldGraphqlConfig {
    pub field_name: ast::Name,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, Default)]
pub struct ModelGraphQlApi {
    pub arguments_input_config: Option<ModelGraphqlApiArgumentsConfig>,
    pub select_uniques: Vec<SelectUniqueGraphQlDefinition>,
    pub select_many: Option<SelectManyGraphQlDefinition>,
    pub select_aggregate: Option<SelectAggregateGraphQlDefinition>,
    pub order_by_expression: Option<ModelOrderByExpression>,
    pub limit_field: Option<LimitFieldGraphqlConfig>,
    pub offset_field: Option<OffsetFieldGraphqlConfig>,
    pub filter_input_type_name: Option<ast::TypeName>,
}

#[derive(Debug, thiserror::Error)]
pub enum ModelGraphqlIssue {
    #[error(
        "the model {model_name} has defined a selectAggregate graphql API, but it will not appear in the GraphQL API unless query.aggregate.filterInputFieldName is also configured in GraphqlConfig"
    )]
    MissingAggregateFilterInputFieldNameInGraphqlConfig { model_name: Qualified<ModelName> },

    #[error("the model {model_name} has a duplicate root field in the GraphQL schema: {error:}")]
    DuplicateRootField {
        model_name: Qualified<ModelName>,
        error: DuplicateRootFieldError,
    },

    #[error(
        "model arguments graphql input configuration has been specified for model {model_name:} that does not have arguments"
    )]
    UnnecessaryModelArgumentsGraphQlInputConfiguration { model_name: Qualified<ModelName> },
    #[error(
        "an unnecessary filter input type name graphql configuration has been specified for model {model_name:} that does not use aggregates"
    )]
    UnnecessaryFilterInputTypeNameGraphqlConfiguration { model_name: Qualified<ModelName> },

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Add query.aggregate.filterInputFieldName to the model's GraphQL config
  2. Or remove selectAggregate if aggregates are not intended

Example fix

# before
graphql:
  select_aggregate: {}
# after
graphql:
  select_aggregate:
    query:
      aggregate:
        filter_input_field_name: where
Defensive patterns

Strategy: validation

Validate before calling

if model.select_aggregate.is_some() {
    warn_if!(graphql_config.query.aggregate.filter_input_field_name.is_none());
}

Prevention

When it happens

Trigger: Enabling selectAggregate on a model while the GraphQL config lacks the filterInputFieldName under query.aggregate.

Common situations: Partial aggregate configuration where developers expect an aggregate root field but it never shows up in the schema.

Related errors


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