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

Fixedbug to handle Union type #4

Merged
merged 1 commit into from
Apr 24, 2018
Merged

Fixedbug to handle Union type #4

merged 1 commit into from
Apr 24, 2018

Conversation

0xSalman
Copy link

This PR fixes bug to handle graphql Union type when using field resolvers. The actual change is one line

For testing, just run ./src/example/social/server.go and try query for Search. The search text has no bearing on the response

@@ -176,3 +188,9 @@ func (r *Resolver) User(ctx context.Context, args struct{ Id string }) (user, er
err := fmt.Errorf("user with id=%s does not exist", args.Id)
return user{}, err
}

func (r *Resolver) Search(ctx context.Context, args struct{ Text string }) ([]*searchResult, error) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terrible example of search, but not exactly a blocker I suppose.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

example is updated to be somewhat better

@0xSalman 0xSalman merged commit de6fb84 into master Apr 24, 2018
@0xSalman 0xSalman deleted the bug-union-type branch April 24, 2018 17:37
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.

4 participants