Skip to content

coprocessor: fix parsing of graphql responses with null as data (backport #7141)#7315

Merged
IvanGoncharov merged 2 commits into1.xfrom
mergify/bp/1.x/pr-7141
Apr 22, 2025
Merged

coprocessor: fix parsing of graphql responses with null as data (backport #7141)#7315
IvanGoncharov merged 2 commits into1.xfrom
mergify/bp/1.x/pr-7141

Conversation

@IvanGoncharov
Copy link
Contributor

Coprocessor deserialized GraphQL response using serde_json directly that resulted in data: null were ignored.
After my change, it's using Response::from_value, which applies the same steps for parsing GraphQL response that we are already using for parsing subgraph response.


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Tests added and passing3
    • Unit Tests
    • Integration Tests
    • Manual Tests

Exceptions

Note any exceptions here

Notes

[ROUTER-1219]: https://apollographql.atlassian.net/browse/ROUTER-1219?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ


This is an automatic backport of pull request #7141 done by Mergify.

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

)

(cherry picked from commit 388afab)

# Conflicts:
#	apollo-router/src/graphql/request.rs
#	apollo-router/src/metrics/mod.rs
#	apollo-router/src/plugins/coprocessor/execution.rs
#	apollo-router/src/plugins/coprocessor/supergraph.rs
#	apollo-router/src/plugins/coprocessor/test.rs
@IvanGoncharov IvanGoncharov requested a review from a team April 18, 2025 12:34
@IvanGoncharov IvanGoncharov requested a review from a team as a code owner April 18, 2025 12:34
@mergify mergify bot added the conflicts label Apr 18, 2025
@IvanGoncharov IvanGoncharov requested a review from a team as a code owner April 18, 2025 12:34
@mergify
Copy link
Contributor

mergify bot commented Apr 18, 2025

Cherry-pick of 388afab has failed:

On branch mergify/bp/1.x/pr-7141
Your branch is up to date with 'origin/1.x'.

You are currently cherry-picking commit 388afabe.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   .changesets/fix_fix_coprocessor_data_null.md
	modified:   apollo-router/src/graphql/mod.rs
	modified:   apollo-router/src/graphql/response.rs
	modified:   apollo-router/src/graphql/visitor.rs
	modified:   apollo-router/src/plugins/coprocessor/mod.rs
	modified:   apollo-router/src/plugins/demand_control/cost_calculator/static_cost.rs
	modified:   apollo-router/src/services/subgraph_service.rs
	modified:   apollo-router/tests/integration/coprocessor.rs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   apollo-router/src/graphql/request.rs
	both modified:   apollo-router/src/metrics/mod.rs
	both modified:   apollo-router/src/plugins/coprocessor/execution.rs
	both modified:   apollo-router/src/plugins/coprocessor/supergraph.rs
	both modified:   apollo-router/src/plugins/coprocessor/test.rs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented Apr 18, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 3f23923a76d1e2acf33704af

@IvanGoncharov IvanGoncharov force-pushed the mergify/bp/1.x/pr-7141 branch from 4d5089b to 910a488 Compare April 18, 2025 14:00
@router-perf
Copy link

router-perf bot commented Apr 20, 2025

CI performance tests

  • connectors-const - Connectors stress test that runs with a constant number of users
  • 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

@IvanGoncharov IvanGoncharov merged commit d69fda9 into 1.x Apr 22, 2025
14 of 15 checks passed
@IvanGoncharov IvanGoncharov deleted the mergify/bp/1.x/pr-7141 branch April 22, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments