{"record":{"id":"93e7a046fa01215e","repo":"hasura/graphql-engine","slug":"model-model-name-is-marked-as-an-apollo-federat","errorCode":null,"errorMessage":"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:}","messagePattern":"Model (.+?) is marked as an Apollo Federation entity source but there are no keys fields present in the related object type (.+?)","errorType":"validation","errorClass":"ApolloError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/apollo/mod.rs","lineNumber":62,"sourceCode":"    },\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":44,"sourceCodeEnd":74,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/apollo/mod.rs#L44-L74","documentation":"This is the inverse of error 855: a model is flagged apolloFederation.entitySource: true, but the object type it maps to has no apolloFederation.keys defined. An entity source without key fields cannot be referenced by federation queries, so the metadata resolver fails validation to flag the inconsistent configuration.","triggerScenarios":"Marking a model with apolloFederation.entitySource: true while the object type named in the model's GraphQL mapping has no apolloFederation.keys block (or it was removed/renamed).","commonSituations":"Adding entitySource to a model but forgetting to add keys on the type; renaming the object type so the keys block stayed behind on the old type name; cleaning up 'unused' federation keys on a type while a model still references it as entity source.","solutions":["Add an apolloFederation.keys entry (with valid, non-empty field lists) to the object type named in the error.","Verify the model's graphql type_name matches the type that carries the keys.","Alternatively, if federation is not intended for this model, remove the entitySource flag."],"exampleFix":"# before\ntype: users\n# no apolloFederation block\nmodels:\n  users:\n    apolloFederation:\n      entitySource: true\n# after\ntype: users\napolloFederation:\n  keys:\n    - [id]\nmodels:\n  users:\n    apolloFederation:\n      entitySource: true","handlingStrategy":"validation","validationCode":"fn entity_config_consistent(types: &TypeMap, model: &Model) -> bool {\n    let type_name = model.graphql.type_name;\n    types.get(&type_name).and_then(|t| t.apollo_federation.as_ref())\n        .map(|af| !af.keys.is_empty()).unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add keys and entitySource flags in the same change.","When renaming a type, move the whole apolloFederation block with it."],"tags":["hasura","apollo-federation","metadata","entity-source","entity-keys"],"backgroundTag":"apollo-federation-misconfiguration","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}