hi all - not sure where to ask this ... noob playi...
# orm-help
q
hi all - not sure where to ask this ... noob playing around with react / apollo / graphcool. i have a mutation that needs the logged-in user's id. what's the easiest way to access it?
j
This isn't really prisma related. But in our app, we have a basic function in the resolver to get the auth info from the request and add it to the mutation
so this is something that will happen at the apollo layer
k
When the user authenticates and you generate the token, stick the ID into an in-memory map that maps token to id.
j
Depending on your server setup, you could also attach the user object onto each request using middleware, making it available via context in your resolvers
q
thanks all! lots for me to google ... 🙂
j
thats exactly what we do.