You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to make the current user easily available in resolvers, for instance, so that I can filter entities by the current user.
I think one supported way would be to add the user to the context, but I would like to have it in a "more typesafe" and less verbose form in the resolvers, so I wondered if something like ControllerArgumentResolvers exists for resolvers.
But in that case again we need to send the string value in the GraphQL query, which makes sense when we are for instance updating the user.
But what about when we're talking about a query/mutation where we don't want to supply the user - an example could be a query "give me all blog posts of the current user" - in that case we don't want to pass the user as an argument, but rather fetch it from symfonys security system. But I'd like to avoid doing that in every provider, I'd rather prefer having that similarly to how the User-Controller-Argument-Resolver does that for symfony controller.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I would like to make the current user easily available in resolvers, for instance, so that I can filter entities by the current user.
I think one supported way would be to add the user to the context, but I would like to have it in a "more typesafe" and less verbose form in the resolvers, so I wondered if something like ControllerArgumentResolvers exists for resolvers.
Beta Was this translation helpful? Give feedback.
All reactions