hasura/graphql-engine · error · ApolloError

model {model_name:} with arguments is unsupported as an Apol

Error message

model {model_name:} with arguments is unsupported as an Apollo Federation entity source

What it means

Raised by the Apollo Federation stage when a model marked as a federation entity source (apolloFederation.entitySource: true) also declares arguments. Federation entity resolution requires the entity source model to be resolvable by key fields alone; models with arguments cannot be invoked that way, so this combination is rejected during metadata validation.

Source

Thrown at v3/crates/metadata-resolve/src/stages/apollo/mod.rs:57

        "unknown field {field_name:} in apollo federation keys defined for the object type {object_type:}"
    )]
    UnknownFieldInApolloFederationKey {
        field_name: FieldName,
        object_type: Qualified<CustomTypeName>,
    },
    #[error(
        "empty keys in apollo federation configuration defined for the object type {object_type:}"
    )]
    EmptyKeysInApolloFederationConfigForObject {
        object_type: Qualified<CustomTypeName>,
    },
    #[error(
        "'apolloFederation.keys' for type {object_type:} found, but no model found with 'apolloFederation.entitySource: true' for type {object_type:}"
    )]
    ApolloFederationEntitySourceNotDefined {
        object_type: Qualified<CustomTypeName>,
    },
    #[error(
        "model {model_name:} with arguments is unsupported as an Apollo Federation entity source"
    )]
    ModelWithArgumentsAsApolloFederationEntitySource { model_name: Qualified<ModelName> },

    #[error(
        "Model {model_name:} is marked as an Apollo Federation entity source but there are no keys fields present in the related object type {type_name:}"
    )]
    NoKeysFieldsPresentInEntitySource {
        type_name: Qualified<CustomTypeName>,
        model_name: ModelName,
    },
    #[error("multiple models are marked as entity source for the object type {type_name:}")]
    MultipleEntitySourcesForType {
        type_name: Qualified<CustomTypeName>,
    },
}

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Remove the arguments from the entity-source model, or move the parameterized logic to a separate (non-entity-source) model/command.
  2. If the argument conveys request context, use session variables or a command with arguments exposed as GraphQL arguments instead of model arguments.
  3. Ensure the model used as entity source is a plain key-addressable data model.

Example fix

# before
models:
  users:
    arguments:
      tenant_id: ...
    apolloFederation:
      entitySource: true
# after
models:
  users:
    # arguments removed; tenant handled via session variable
    apolloFederation:
      entitySource: true
Defensive patterns

Strategy: validation

Validate before calling

fn can_be_entity_source(model: &Model) -> bool {
    model.arguments.is_empty()
}

Prevention

When it happens

Trigger: Setting apolloFederation.entitySource: true on a model that also declares arguments (e.g. an argument for filtering, tenant selection, or pagination) in its metadata.

Common situations: Adding an argument to an existing entity-source model and breaking federation; converting a command model into an entity source; multi-tenant setups that pass tenant context as a model argument instead of using session variables.

Related errors


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