Skip to content

Fix Scalar Path generation for queries with inline fragments #333

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

Merged
merged 1 commit into from
Sep 1, 2022

Conversation

kamilJ96
Copy link
Contributor

@kamilJ96 kamilJ96 commented Aug 29, 2022

If a query contains an inline fragment to select a specific type from a union type, currently the PrepareScalarPaths function will add the inline fragment to the path list. However, when a response is being decoded, this inline fragment is not present on the generated path for a scalar, and so custom scalars can't find their correct decoder.

For e.g:

cards {
  ... on Card {
    info
  }
}

will result in the scalar path being generated as ['Query', 'cards', '... on Card', 'info'], however the response scalar path is generated as ['Query', 'cards', 'info'], as an inline fragment isn't a field

@aexol aexol merged commit 0d2be38 into graphql-editor:master Sep 1, 2022
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.

2 participants