Skip to content

Is it possible to inject spring beans into data fetchers? #1048

Answered by berngp
onomesotu asked this question in Q&A
Discussion options

You must be logged in to vote

That pattern is not currently supported, that said, recent changes in master will make this possible in the near future. In the meantime, you could use the SecurityContextHolder to fetch the Authentication from thread local.

Please consider that the bean exposing the method used for data fetching is a managed bean and you can inject in its constructor any other bean that you want.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@onomesotu
Comment options

Answer selected by onomesotu
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@srinivasankavitha
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants