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

Fix Mapping Custom Scalar to Slice #637

Merged
merged 2 commits into from
Mar 31, 2019
Merged

Fix Mapping Custom Scalar to Slice #637

merged 2 commits into from
Mar 31, 2019

Conversation

mathewbyrne
Copy link
Contributor

Fixes #597

This updates the TypeReference.IsSlice logic to also look at the GraphQL type. Previously this was only looking at the Go type, which was breaking for types whose return is not a slice.

I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs)

Mathew Byrne added 2 commits March 18, 2019 17:27
Currently TypeReference.IsSlice only looks at the Go type to decide.
This should also take into account the GraphQL type as well, to cover
cases such as a scalar mapping to []byte
@mathewbyrne mathewbyrne requested a review from vektah March 18, 2019 06:39
Copy link
Collaborator

@vektah vektah left a comment

Choose a reason for hiding this comment

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

LGTM

@mathewbyrne mathewbyrne merged commit ef2e51b into master Mar 31, 2019
@mtibben mtibben deleted the fix-is-slice branch June 11, 2019 00:43
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
Fix Mapping Custom Scalar to Slice
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