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

Field merging #573

Closed
wants to merge 3 commits into from
Closed

Field merging #573

wants to merge 3 commits into from

Conversation

nbudin
Copy link

@nbudin nbudin commented Oct 11, 2024

PR Checklist:

PR Description

This merges multiple references to the same field together when that field has subfields. It fixes both the simple case given in #572 and also the more complicated case involving fragment spreads.

I'm having some trouble reaching 100% test coverage with this. Jest is telling me that line 577 of GraphQLToOpenAPIConverter.ts is uncovered, but from what I can tell, that line is actually being invoked in the tests I added (if it wasn't, my tests should fail). I'd love any pointers on how to fix this!

@nbudin nbudin marked this pull request as ready for review October 11, 2024 19:41
@nbudin
Copy link
Author

nbudin commented Oct 15, 2024

Found a bug while manually testing this that my test cases hadn't covered - working on a fix, will update here when it's done.

@nbudin
Copy link
Author

nbudin commented Oct 21, 2024

After some more attempts at this, I'm actually going to give up. I'm sorry about this. It looks like while my original test case works ok, the reverse of it doesn't, e.g.:

query fieldMergingWithSubfieldFragmentSpread($id: ID!) {
  person(id: $id) {
    id
    firstName
    lastName

    address {
      country
    }

    ...addressSubfields
  }
}

I'm going to attempt to work around this in a different way on my end.

@nbudin nbudin closed this Oct 21, 2024
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.

1 participant