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
Hello! I just started with my pet project using express and this library to serve my graphql endpoint, and I hit a snag when developing some authentication methods.
It is my understanding that in order to log out, the server should be the one setting the cookies to expire to abstract it from the Frontend, but I wasn't capable of finding that snippet of code in your documentation.
I sort of pieced together what might be helpful and this is what I came up with
importexpressfrom"express";import{schema}from"./schema";import{createHandler}from"graphql-http/lib/use/express";constapp=express();app.use("/graphql",(req,res,next)=>createHandler({
schema,context: (req)=>({ req, res }),})(req,res,next));// Start the serverconstPORT=4000;app.listen(PORT,()=>{console.log(`Server is running at http://localhost:${PORT}/graphql`);});
I would very much appreciate any validation if there's any issue applying such code.
My intention is that for the logout mutation, the resolver can influence the response by setting some headers.
Thank you
The text was updated successfully, but these errors were encountered:
Hello! I just started with my pet project using express and this library to serve my graphql endpoint, and I hit a snag when developing some authentication methods.
It is my understanding that in order to log out, the server should be the one setting the cookies to expire to abstract it from the Frontend, but I wasn't capable of finding that snippet of code in your documentation.
I sort of pieced together what might be helpful and this is what I came up with
I would very much appreciate any validation if there's any issue applying such code.
My intention is that for the
logout
mutation, the resolver can influence the response by setting some headers.Thank you
The text was updated successfully, but these errors were encountered: