apollo-ios-dev icon indicating copy to clipboard operation
apollo-ios-dev copied to clipboard

Field Merging[2/x] Compute MergedSelections w/MergingStrategy

Open AnthonyMDev opened this issue 1 year ago • 4 comments

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.


AnthonyMDev avatar Mar 21 '24 22:03 AnthonyMDev

[!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

  • #350 Graphite
  • #344 Graphite
  • #343 Graphite
  • #318 Graphite
  • #307 Graphite 👈
  • #306 Graphite
  • #308 Graphite
  • main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @AnthonyMDev and the rest of your teammates on Graphite Graphite

AnthonyMDev avatar Mar 21 '24 22:03 AnthonyMDev

@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

tahirmt avatar Mar 26 '24 03:03 tahirmt

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

AnthonyMDev avatar Mar 26 '24 15:03 AnthonyMDev

Ah no worries. I was just too excited to try out.

tahirmt avatar Mar 26 '24 15:03 tahirmt

Closing. This is replaced by #431

AnthonyMDev avatar Jul 16 '24 20:07 AnthonyMDev