Hey guys! I’m a bit confused by a section in this ...
# prisma-whats-new
t
Hey guys! I’m a bit confused by a section in this tutorial: https://www.graph.cool/docs/tutorials/react-apollo-email-oopheesaj9/#2.2-handling-authenticated-status Not sure if anyone can help me understand this. What I understand is that this will fetch directly from the server the id and name, but how does the server know which user’s info to give back if the client doesn’t provide any information?
a
The
user
query that is predefined in graphcool utilizes a token that you send with the request to get the currently logged in user information to return in that particular query.
t
ah! so this is predefined in graphcool, is there a place where I can check this predefined stuff in graphcool?
Thanks for the answer btw!
a
The easiest way I've found is just to play around in the playground. If you head over there you can hit Ctrl+Space at any point within a query to see a list of what's available. The other way is to read up on the API query docs to see what other magic methods you can use: https://www.graph.cool/docs/reference/simple-api/queries-nia9nushae/ The authentication is outlined a bit more here: https://www.graph.cool/docs/reference/simple-api/session-user-gieh7iw2ru/
t
Awesome! thanks @abeagley
👍 1
a
Another suggestion, if you go to your endpoint in the browser, you get a Playground that has a better DOCS experience than the one in the console. The Docs show you all the generated queries and mutations, with all their arguments and return values
😍 1
t
@agartha this is soooo awesome! this is what I needed, thank you so much!
😎 1