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

Expose query's selected fields to resolvers via context #373

Closed

Conversation

keithmattix
Copy link

@keithmattix keithmattix commented Jan 7, 2020

Since #169 seems to have stagnated a bit, I decided to throw my hat in the ring. I'm not sure how everyone feels about exposing this information via context vs. a third parameter, but hopefully this can serve as a starting point for more discussion on the issue. Fixes #17

@willglynn
Copy link

I would rather have field selections exposed as an argument (#169) than via Context (this PR). If my resolver needs field selections, it's because there's logic in my resolver which depends on those field selections, and I'd prefer to state that explicitly in my resolver's function signature. My resolvers' use of Context typically doesn't affect control flow, while field selection always does.

Having said that, I would rather have field selections exposed via Context than not exposed at all. This kind of functionality is important to me, and regardless of how it's exposed, merging either PR would allow me to stop using a fork.

@dusansimic
Copy link

This feature is really useful to me and it'd be very nice if it gets pulled. I hope this will be done soon.

@keithmattix
Copy link
Author

Closing in favor of #428

@keithmattix keithmattix closed this Jan 2, 2021
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.

No way to get requested fields inside resolver
3 participants