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

Question: How to get cookies from the QueryResult response? #335

Closed
aagarwal1012 opened this issue Jun 12, 2019 · 6 comments
Closed

Question: How to get cookies from the QueryResult response? #335

aagarwal1012 opened this issue Jun 12, 2019 · 6 comments
Labels
needs more info More information is required

Comments

@aagarwal1012
Copy link

aagarwal1012 commented Jun 12, 2019

It would be really helpful if any can tell the way to extract 'cookies' from the response {QueryResult}.

@request-info
Copy link

request-info bot commented Jun 12, 2019

We would appreciate it if you could provide us with more info about this issue/pr!

@request-info request-info bot added the needs more info More information is required label Jun 12, 2019
@micimize
Copy link
Collaborator

micimize commented Jun 13, 2019

I think cookies are a header, so you'd have to grab them in a link.
If you figure it out, adding an example here would be appreciated

@aagarwal1012
Copy link
Author

@micimize, but how can I get headers from the QueryResult response? Since the cookie will be returned only after a successful query request.

@micimize
Copy link
Collaborator

QueryResults don't pass down that kind of raw data - you'll have to check for headers in a custom link and grab cookies when they're set. Here in HttpLink is where the raw response gets parsed.

A link for handling response cookies automatically would be a good feature, as apollo seems to, but does not currently exist.

@aagarwal1012
Copy link
Author

aagarwal1012 commented Jun 13, 2019

@micimize, #342 adds headers parameter for FetchResult and QueryResult, so as to get set-cookie value from the response headers. Thanks!

@micimize
Copy link
Collaborator

micimize commented Aug 3, 2019

closing in favor of considering a rawFetchResult getter (#371)

@micimize micimize closed this as completed Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info More information is required
Projects
None yet
Development

No branches or pull requests

2 participants