apollo-ios-dev
apollo-ios-dev copied to clipboard
Field Merging[2/x] Compute MergedSelections w/MergingStrategy
TL;DR
Updated the logic for merging selections in ComputedSelectionSet.
What changed?
- Implemented a new MergedSelections logic to handle different merging strategies.
How to test?
Unit tests will be written before this PR is marked ready for review.
Why make this change?
To improve the handling of merged selections in ComputedSelectionSet based on different merging strategies.
[!WARNING] This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite. Learn more
This stack of pull requests is managed by Graphite. Learn more about stacking.
Join @AnthonyMDev and the rest of your teammates on
Graphite
@AnthonyMDev I ran this branch without field merging and I'm still seeing merged fields. I reproduced it on a sample project for easy review https://github.com/tahirmt/apollo-codegen-demo. Maybe I missed something but I think I got everything set up correctly.
Here fieldMerging is set to none
https://github.com/tahirmt/apollo-codegen-demo/blob/98b3390ecb0b35e3c4939176656f44442a90aab0/Sources/codegen/Command.swift#L31
And here is the generated query still showing merged fields https://github.com/tahirmt/apollo-codegen-demo/blob/98b3390ecb0b35e3c4939176656f44442a90aab0/API/Sources/Operations/Queries/NodeQuery.graphql.swift#L60
Let me know if I missed anything
I made a very silly oversight yesterday. While the field merging strategies work properly, they are not actually affecting the generated templates yet. I'm going to get that sorted out today and will have another PR up with this working soon! Sorry for the confusion @tahirmt
Ah no worries. I was just too excited to try out.
Closing. This is replaced by #431