Skip to content

Upgrade to new visitor traits in validation#5812

Merged
dylan-apollo merged 2 commits intonextfrom
dylan/switch-validation-visitors
Aug 15, 2024
Merged

Upgrade to new visitor traits in validation#5812
dylan-apollo merged 2 commits intonextfrom
dylan/switch-validation-visitors

Conversation

@dylan-apollo
Copy link
Contributor

@dylan-apollo dylan-apollo commented Aug 13, 2024

Also now detects when a scalar field is selected which isn't defined.

@router-perf
Copy link

router-perf bot commented Aug 13, 2024

CI performance tests

  • const - Basic stress test that runs with a constant number of users
  • demand-control-instrumented - A copy of the step test, but with demand control monitoring and metrics enabled
  • demand-control-uninstrumented - A copy of the step test, but with demand control monitoring enabled
  • enhanced-signature - Enhanced signature enabled
  • events - Stress test for events with a lot of users and deduplication ENABLED
  • events_big_cap_high_rate - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity
  • events_big_cap_high_rate_callback - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity using callback mode
  • events_callback - Stress test for events with a lot of users and deduplication ENABLED in callback mode
  • events_without_dedup - Stress test for events with a lot of users and deduplication DISABLED
  • events_without_dedup_callback - Stress test for events with a lot of users and deduplication DISABLED using callback mode
  • extended-reference-mode - Extended reference mode enabled
  • large-request - Stress test with a 1 MB request payload
  • no-tracing - Basic stress test, no tracing
  • reload - Reload test over a long period of time at a constant rate of users
  • step-jemalloc-tuning - Clone of the basic stress test for jemalloc tuning
  • step-local-metrics - Field stats that are generated from the router rather than FTV1
  • step-with-prometheus - A copy of the step test with the Prometheus metrics exporter enabled
  • step - Basic stress test that steps up the number of users over time
  • xlarge-request - Stress test with 10 MB request payload
  • xxlarge-request - Stress test with 100 MB request payload

Copy link
Contributor

@nicholascioli nicholascioli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I'm glad that the visitor allowed for better validation handling.

Err(Message {
code: Code::GroupSelectionIsNotObject,
message: format!(
"{coordinate} selects a group `{field_name}{{}}`, but `{parent_type}.{field_name}` is of type `{type_name}` which is not an object.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the extra {{}} needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to have the braces to better indicate to users what we mean by "group", since that's not a term they'll necessarily be familiar with. So the message would be like "selections a group user {}", evoking the selection syntax.

Comment on lines -61 to -71
fn get_group_fields(
&self,
group: InputObjectTypeDefinitionPosition,
) -> Result<
Vec<InputObjectFieldDefinitionPosition>,
<Self as FieldVisitor<InputObjectFieldDefinitionPosition>>::Error,
> {
let def = group.get(self.original_schema.schema())?;
Ok(def.fields.keys().cloned().map(|f| group.field(f)).collect())
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call removing this. I originally had it to make it slightly more modular but then only used it in one spot that needed to be implemented anyway.

@dylan-apollo dylan-apollo merged commit e87b2e8 into next Aug 15, 2024
@dylan-apollo dylan-apollo deleted the dylan/switch-validation-visitors branch August 15, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants