{"record":{"id":"4b9372d693899890","repo":"hasura/graphql-engine","slug":"model-model-name-with-arguments-is-unsupported","errorCode":null,"errorMessage":"model {model_name:} with arguments is unsupported as an Apollo Federation entity source","messagePattern":"model (.+?) with arguments is unsupported as an Apollo Federation entity source","errorType":"validation","errorClass":"ApolloError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/apollo/mod.rs","lineNumber":57,"sourceCode":"        \"unknown field {field_name:} in apollo federation keys defined for the object type {object_type:}\"\n    )]\n    UnknownFieldInApolloFederationKey {\n        field_name: FieldName,\n        object_type: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"empty keys in apollo federation configuration defined for the object type {object_type:}\"\n    )]\n    EmptyKeysInApolloFederationConfigForObject {\n        object_type: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"'apolloFederation.keys' for type {object_type:} found, but no model found with 'apolloFederation.entitySource: true' for type {object_type:}\"\n    )]\n    ApolloFederationEntitySourceNotDefined {\n        object_type: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"model {model_name:} with arguments is unsupported as an Apollo Federation entity source\"\n    )]\n    ModelWithArgumentsAsApolloFederationEntitySource { model_name: Qualified<ModelName> },\n\n    #[error(\n        \"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:}\"\n    )]\n    NoKeysFieldsPresentInEntitySource {\n        type_name: Qualified<CustomTypeName>,\n        model_name: ModelName,\n    },\n    #[error(\"multiple models are marked as entity source for the object type {type_name:}\")]\n    MultipleEntitySourcesForType {\n        type_name: Qualified<CustomTypeName>,\n    },\n}\n","sourceCodeStart":39,"sourceCodeEnd":74,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/apollo/mod.rs#L39-L74","documentation":"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.","triggerScenarios":"Setting apolloFederation.entitySource: true on a model that also declares arguments (e.g. an argument for filtering, tenant selection, or pagination) in its metadata.","commonSituations":"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.","solutions":["Remove the arguments from the entity-source model, or move the parameterized logic to a separate (non-entity-source) model/command.","If the argument conveys request context, use session variables or a command with arguments exposed as GraphQL arguments instead of model arguments.","Ensure the model used as entity source is a plain key-addressable data model."],"exampleFix":"# before\nmodels:\n  users:\n    arguments:\n      tenant_id: ...\n    apolloFederation:\n      entitySource: true\n# after\nmodels:\n  users:\n    # arguments removed; tenant handled via session variable\n    apolloFederation:\n      entitySource: true","handlingStrategy":"validation","validationCode":"fn can_be_entity_source(model: &Model) -> bool {\n    model.arguments.is_empty()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep entity-source models argument-free; expose parameterized reads via commands instead.","Pass request context via session variables, not model arguments."],"tags":["hasura","apollo-federation","metadata","model-arguments","entity-source"],"backgroundTag":"apollo-federation-misconfiguration","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}