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

Doesn't handle nested Fragments #14

Open
francispoole opened this issue Dec 10, 2021 · 3 comments · May be fixed by #23
Open

Doesn't handle nested Fragments #14

francispoole opened this issue Dec 10, 2021 · 3 comments · May be fixed by #23
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@francispoole
Copy link

Many thanks for the repo! Still baffles me URQL and Apollo haven't got something like this natively...

A bug i've noticed is that this doesn't support nested Fragment's:
e.g.

query myQuery {
  object1 {
    fieldA,
    ...object1Fields
  }
}

fragment object1Fields on object1 {
  fieldB,
  object2 {
    ...object2Fields
  }
}

fragment object2Fields on object2 {
  fieldC,
}

fieldA and fieldB are mapped properly, but fieldC is ignored. Pulling the field out of the object2Fields fragment and putting it directly in to object1Fields does however work.
e.g.

query myQuery {
  object1 {
    fieldA,
    ...object1Fields
  }
}

fragment object1Fields on object1 {
  fieldB,
  object2 {
    fieldC
  }
}
@clentfort clentfort added bug Something isn't working help wanted Extra attention is needed labels Dec 10, 2021
@Warxcell Warxcell mentioned this issue May 3, 2022
@Warxcell
Copy link

Warxcell commented May 3, 2022

Tried to fix it, but failed miserably - but at least I added test case. 😅

@DarryQueen DarryQueen linked a pull request Nov 7, 2022 that will close this issue
@DarryQueen
Copy link

Implemented in #23.

@mvarendorff2
Copy link

The PR linked above is included in the fork available as @atmina/[email protected] on NPM :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants