Skip to content

Add @LocalContextValue for access to attributes from the local GraphQLContext in DataFetchingEnvironment #353

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
andimarek opened this issue Apr 17, 2022 · 3 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@andimarek
Copy link
Contributor

I think it would be useful to have a @LocalContext annotation to allow for the local context to be injected in annotated methods.

Thoughts?

@rstoyanchev
Copy link
Contributor

In light of the planned improvement under #354, I am closing this for now since a local context value can be accessed through @ContextValue, but we can always re-open it if needed.

@rstoyanchev rstoyanchev added the status: declined A suggestion or change that we don't feel we should currently apply label May 5, 2022
@rstoyanchev
Copy link
Contributor

rstoyanchev commented May 5, 2022

Re-opening, given the direction taken with #354.

@rstoyanchev rstoyanchev changed the title local context Add @LocalContextValue for access to attributes from the local GraphQLContext in DataFetchingEnvironment May 5, 2022
@rstoyanchev rstoyanchev reopened this May 6, 2022
@rstoyanchev rstoyanchev added type: enhancement A general enhancement and removed status: declined A suggestion or change that we don't feel we should currently apply labels May 6, 2022
@rstoyanchev rstoyanchev self-assigned this May 6, 2022
@rstoyanchev rstoyanchev added this to the 1.0.0 milestone May 6, 2022
@rstoyanchev
Copy link
Contributor

In summary, there is now @ContextValue and @LocalContextValue, each binding from the main or the local GraphQLContext respectively. That means existing code accessing the local context will now have to switch to @LocalContextValue.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants