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

Union Fragment Bug Fix #526

Merged
merged 3 commits into from
Feb 7, 2019
Merged

Union Fragment Bug Fix #526

merged 3 commits into from
Feb 7, 2019

Conversation

mathewbyrne
Copy link
Contributor

@mathewbyrne mathewbyrne commented Feb 4, 2019

Closes #399

The issue that is being run into is that union types delegate their field collection to the concrete type that is resolved. The problem occurs when the selection is on a Union type, which is not listed in the concrete implementors, and thus is skipped during field collection.

The solution is to include Unions in the list of implementors for each concrete type. This can be retrieved with ast.Schema.GetImplements.

@vektah has already fixed this issue in https://github.com/99designs/gqlgen/tree/multiple-bind-types which will merge prior to next release.

Not quite, a small fix is still required in this PR.

@mathewbyrne mathewbyrne changed the title Union Fragment Bug Union Fragment Bug Feb 7, 2019
@mathewbyrne mathewbyrne changed the title Union Fragment Bug Union Fragment Bug Fix Feb 7, 2019
Mathew Byrne added 3 commits February 8, 2019 10:31
These conditions are not really related, and I missed the second
conditional when reading through the first time.
@mathewbyrne mathewbyrne merged commit 03a655d into next Feb 7, 2019
@porty porty deleted the union-fragment-bug branch February 8, 2019 18:37
@vektah vektah mentioned this pull request Mar 4, 2019
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 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.

1 participant