hasura/graphql-engine · error · RelayError
model {model_name:} with arguments is unsupported as a globa
Error message
model {model_name:} with arguments is unsupported as a global ID source What it means
Relay stage error: a model marked globalIdSource: true declares arguments (e.g. a custom select with mandatory arguments). Argumented models cannot serve as deterministic Relay global ID sources, so resolution rejects the combination.
Source
Thrown at v3/crates/metadata-resolve/src/stages/relay/mod.rs:47
GlobalIdSourceNotDefined {
object_type: Qualified<CustomTypeName>,
},
#[error(
"Model {model_name:} is marked as a global ID source but there are no global id fields present in the related object type {type_name:}"
)]
NoGlobalFieldsPresentInGlobalIdSource {
type_name: Qualified<CustomTypeName>,
model_name: ModelName,
},
#[error(
"Found multiple models {model_1:}, {model_2:} that implement the same object type {object_type:} to be global ID sources."
)]
DuplicateModelGlobalIdSource {
model_1: Qualified<ModelName>,
model_2: Qualified<ModelName>,
object_type: Qualified<CustomTypeName>,
},
#[error("model {model_name:} with arguments is unsupported as a global ID source")]
ModelWithArgumentsAsGlobalIdSource { model_name: Qualified<ModelName> },
}
View on GitHub (pinned to 724551b9ae)
Solutions
- Remove the arguments from the model, or point globalIdSource at an argument-free model for the same type
- If arguments are required, drop globalIdSource from this model and remove globalIdFields from the type (if no other source exists)
- Split into two models: a plain one as global ID source and the argumented one for queries
Example fix
# before
kind: Model
name: UsersByTenant
objectType: User
globalIdSource: true
arguments:
tenantId: { type: String! }
# after
kind: Model
name: Users
objectType: User
globalIdSource: true
---
kind: Model
name: UsersByTenant
objectType: User
arguments:
tenantId: { type: String! } Defensive patterns
Strategy: validation
Validate before calling
fn check_global_id_model_has_no_args(models: &[Model]) -> Result<(), String> {
for m in models {
if m.global_id_source && !m.arguments.is_empty() {
return Err(format!("model {} has arguments; cannot be globalIdSource", m.name));
}
}
Ok(())
} Try / catch
match ModelWithArgumentsAsGlobalIdSource and suggest moving the flag to an argument-free model
Prevention
- Keep a plain unparameterized model per object type as the Relay node source
- Re-check this invariant whenever adding arguments to models
When it happens
Trigger: Setting globalIdSource: true on a model whose definition includes command arguments (modelWithArguments), such as a filtered or parameterized select model.
Common situations: Reusing an argument-driven model (e.g. 'usersByTenant') as a Relay node source; adding arguments to an existing global-ID model during feature work.
Related errors
- 'globalIdFields' for type {object_type:} found, but no model
- Model {model_name:} is marked as a global ID source but ther
- Found multiple models {model_1:}, {model_2:} that implement
- The global ID {encoded_value:} couldn't be decoded due to {d
- model {model_name:} with arguments is unsupported as an Apol
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/5b24317b8ab68909.
Report an issue: GitHub.