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

feat: add ability to unmarshal Upload from map[string]interface #3330

Closed

Conversation

golanglemonade
Copy link

@golanglemonade golanglemonade commented Oct 15, 2024

Summary:

When using the generated server client, the types come through as a map[string]interface{} rather than a graphql.Upload. This change allows the generic map to be unmarshalled into the Upload type:

example from gen_server.go, this currently fails because its coming through as a map[string]interface{} instead of a graphql.Upload

func (ec *executionContext) unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, v interface{}) (graphql.Upload, error) {
	res, err := graphql.UnmarshalUpload(v)
	return res, graphql.ErrorOnPath(ctx, err)
}

I have:

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

@golanglemonade golanglemonade marked this pull request as draft October 15, 2024 01:41
@golanglemonade
Copy link
Author

golanglemonade commented Oct 15, 2024

this actually looks like a problem with the gqlgenc client, rather than the parser here, going to close this out. sorry for the noise. (ref incase anyone else runs into this: Yamashou/gqlgenc#237)

@golanglemonade golanglemonade deleted the feat-upload-marshal branch October 15, 2024 05:22
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