Skip to content

Commit

Permalink
Force disambiguation between default type_field and the ahash replace…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
tninesling committed Dec 2, 2024
1 parent faa79ba commit d9e0e99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl DemandControlledSchema {
})
}

pub(in crate::plugins::demand_control) fn type_field(
pub(in crate::plugins::demand_control) fn ahashed_type_field(
&self,
type_name: &Name,
field_name: &Name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl StaticCostCalculator {
// because `field.definition` was generated from the API schema, which strips off the directives we need.
let definition = ctx
.schema
.type_field(parent_type, &field.name)
.ahashed_type_field(parent_type, &field.name)
.ok_or_else(|| {
DemandControlError::QueryParseFailure(format!(
"Field {} was found in query, but its type is missing from the schema.",
Expand Down Expand Up @@ -562,7 +562,7 @@ impl<'schema> ResponseVisitor for ResponseCostCalculator<'schema> {
) {
self.visit_list_item(request, variables, parent_ty, field, value);

if let Some(definition) = self.schema.type_field(parent_ty, &field.name) {
if let Some(definition) = self.schema.ahashed_type_field(parent_ty, &field.name) {
for argument in &field.arguments {
if let Some(argument_definition) = definition.argument_by_name(&argument.name) {
if let Ok(score) =
Expand Down

0 comments on commit d9e0e99

Please sign in to comment.