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: issue #65: type of ResolveInfo.RootValue should be interface{} #608

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chirino
Copy link

@chirino chirino commented Aug 3, 2021

changes type of ResolveInfo.RootValue ot be interface{}

I would like to set the RootObject to a struct pointer that my resolvers would rather deal with.

@coveralls
Copy link

coveralls commented Aug 3, 2021

Coverage Status

Coverage increased (+0.4%) to 92.427% when pulling bca2f15 on chirino:issue-65 into f02a1c9 on graphql-go:master.

@chris-ramon
Copy link
Member

@chirino thanks for filing a PR — I don't think we should be changing this end-user type: graphql.Params.RootObject because it would be an API breaking-change.

An alternative strategy would be to have a small wrapper around your resolvers that consolidates map[string]interface{} to interface{} on your end ?

@chirino
Copy link
Author

chirino commented Aug 22, 2021

To avoid the breaking change we could Introduce a new field and deprecate RootValue and ask folks to stop using RootValue.

@chirino
Copy link
Author

chirino commented Aug 25, 2021

@chris-ramon what about this new version?

@bhoriuchi
Copy link
Contributor

RootValue is part of the spec, I don't think deprecating it is a good idea.

That said, will changing it to interface{} actually break it? map[string]interface{} can be assigned to an interface value no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants