Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Allow returning errors when marshaling scalars #743

Closed
pkosiec opened this issue Jun 13, 2019 · 7 comments
Closed

Allow returning errors when marshaling scalars #743

pkosiec opened this issue Jun 13, 2019 · 7 comments
Labels
enhancement New feature or request

Comments

@pkosiec
Copy link

pkosiec commented Jun 13, 2019

I have a case when marshaling a scalar can return an error.

Currently we have the following Marshaler and Unmarshaler interfaces:

type Marshaler interface {
	MarshalGQL(w io.Writer)
}

type Unmarshaler interface {
	UnmarshalGQL(v interface{}) error
}

It'd be great to allow return errors for Marshaler, similarly to Unmarshaler.

versions

  • gqlgen version 0.9.0
@pkosiec pkosiec changed the title Allow return error for scalar marshaling Allow returning errors when marshaling scalars Jun 13, 2019
@stale
Copy link

stale bot commented Aug 28, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 28, 2019
@pkosiec
Copy link
Author

pkosiec commented Aug 28, 2019

This issue is still valid.

@stale stale bot removed the stale label Aug 28, 2019
@stale
Copy link

stale bot commented Oct 27, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 27, 2019
@pkosiec
Copy link
Author

pkosiec commented Oct 27, 2019

Still valid. @vektah if you agree, I can create a PR with this change during my spare time. It would be a breaking change, but I can try to avoid this. Waiting for your feedback. Cheers!

@stale stale bot removed the stale label Oct 27, 2019
@vvakame vvakame added the enhancement New feature or request label Dec 25, 2019
@adrianduke
Copy link

Implementing this would make resolving issue #1195 simpler.

@duckbrain
Copy link
Contributor

Linking #1645 because it also deals with changing the scalar interface.

@duckbrain
Copy link
Contributor

This can probably be closed. #1652; using the context interface allows returning an error.

@frederikhors frederikhors converted this issue into discussion #1905 Feb 4, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants