Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to send multiple cookies via request.cookieStore?.set in a resolver #2609

Closed
Tracked by #2700 ...
Nosherwan opened this issue Mar 26, 2023 · 1 comment
Closed
Tracked by #2700 ...

Comments

@Nosherwan
Copy link

Describe the bug

I am using the latest release "graphql-yoga": "^3.7.3"
I am also using "@whatwg-node/server-plugin-cookies": "^0.0.2" for the cookies plugin

I pass the request object from within a custom context handler to each of the resolvers.

From within the resolvers I try to assign 2 cookies to the request.cookieStore vis the provided example syntax.

The result is only one of the cookies (the last one assigned) is returned to the caller.

Your Example Website or App

https://codesandbox.io/s/relaxed-leftpad-3ri4sy?file=/src/main.ts

Steps to Reproduce the Bug or Issue

  1. Please use the codesandbox link above
  2. Run the sendCookie query resolver in GraphiQL in a separate browser tab.
  3. Observe in the developer tools that only the last cookie is sent not the first one.

Expected behavior

2 Cookies should be sent as are set in the query resolver.

Screenshots or Videos

No response

Platform

  • OS: macOS
  • NodeJS: 18.12.1
  • @graphql-yoga version: 3.7.3
  • @whatwg-node/server-plugin-cookies version: ^0.0.2

Additional context

No response

@ardatan
Copy link
Collaborator

ardatan commented Mar 30, 2023

Fixed in @whatwg-node/server-plugin-cookies@0.0.3!

@ardatan ardatan closed this as completed Mar 30, 2023
This was referenced May 7, 2024
This was referenced May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants