question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Best approach to set headers through helix resolver in SvelteKit

See original GitHub issue

Hello, I want to know what is the best approach to set (or return) headers (cookies to be exact) through helix resolver in SvelteKit? After use login I need to set the jwt and session information in cookies. You can see the Mutation code in here: https://github.com/MirrorBytes/phorm-kit-vercel/blob/283b0c4036db13b799f22cd2b85a3f89ffab6e1b/src/resolvers/user.ts#L53 And the jwt is generated here: https://github.com/MirrorBytes/phorm-kit-vercel/blob/283b0c4036db13b799f22cd2b85a3f89ffab6e1b/src/entities/user.ts#L98 I have noticed that processRequest() function return a result with headers in here: https://github.com/MirrorBytes/phorm-kit-vercel/blob/283b0c4036db13b799f22cd2b85a3f89ffab6e1b/src/routes/graphql.ts#L37

Is there is a way to access the header when processing a request (or resolving a schema) ? Or can you suggest me a good a approach to do this ?

Thank you.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ibiluxcommented, Sep 24, 2021

@AndreasHald I’m using version 1.7.0 it’s working fine (it was released 2 months ago). PS: latest version is 1.8.0, but it should work fine.

1reaction
ibiluxcommented, Aug 25, 2021

Thank you @benbender , I have been thinking about doing this. I just needed another opinion on doing this. Thank you for the confirmation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started - GraphQL Helix
The following example shows how to integrate GraphQL Helix with Node.js using Express. ... headers: req.headers, method: req.method, query: req.query, ...
Read more >
GraphQL Code Libraries, Tools and Services
A powerful JavaScript GraphQL client, designed to work well with React, React Native, Angular 2, or just plain JavaScript. ... A JavaScript library...
Read more >
Authentication – GraphQL Yoga
The first thing you need is a way to represent user data in the database. To do so, you can add a User...
Read more >
SvelteKit Static Site HTTP Headers | Rodney Lab
In this post we look at how to set up SvelteKit static site HTTP headers. ... You can create static sites in SvelteKit...
Read more >
Building a GraphQL server with GraphQL Helix - Reddit
headers, method: req.method, query: req.query, }; const { query, variables, operationName } = getGraphQLParameters(request); const result = ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found