Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PagingOptions.IncludeNodesField option #7396

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

tobias-tengler
Copy link
Collaborator

@tobias-tengler tobias-tengler commented Aug 22, 2024

This PR adds a new IncludeNodesField option on the PagingOptions that allows to turn off the generation of the nodes field on the Connection type.

The nodes fields is mostly for convenience, but it becomes a bit bothersome when using the Relay client and unexperienced Frontend developers. Some of the things that can go wrong and why it might be a good idea to disable the nodes field:

  • Developers selecting both the edges and nodes field from different fragments, leading to double the amount of data being returned
  • If nodes is being used, Relay can't delete stuff from the list automatically, because it doesn't "know" about the nodes field

@tobias-tengler tobias-tengler added the 👓 ready-for-review The PR is ready for review. label Aug 22, 2024
@michaelstaib michaelstaib merged commit efe5acc into main Aug 22, 2024
188 checks passed
@michaelstaib michaelstaib deleted the tte/add-option-to-disable-nodes-field branch August 22, 2024 20:39
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.81%. Comparing base (277615a) to head (52a6e1b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7396      +/-   ##
==========================================
- Coverage   78.87%   77.81%   -1.06%     
==========================================
  Files        2433     2813     +380     
  Lines      119831   140968   +21137     
==========================================
+ Hits        94511   109688   +15177     
- Misses      25320    31280    +5960     
Flag Coverage Δ
unittests 77.81% <100.00%> (-1.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants