-
-
Notifications
You must be signed in to change notification settings - Fork 816
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
Graphql remote schema stiching and cookies #969
Comments
Having same issue, did you solve it? |
I had a similar issue that I resolved by wiring up a custom ApolloLink and a custom GraphQLExtension: https://spectrum.chat/apollo/apollo-server/makeremoteexecutableschema-and-response-cookies~3da601de-f533-45a4-9928-d1ff08c68c84?m=MTU1MTIxMDM4OTIxMQ== Here's the text from that post: First, I created a custom ApolloLink to take response headers and add them to the graphqlContext as responseHeaders. This gets concatenated to the beginning of the link chain:
Then I created an GraphQLExtension that adds response headers for any values in the responseHeaders field in the graphqlContext RemoteResponseHeaderExtensions.ts
These two work together to effectively proxy the set-cookie response header from the remote endpoint back to the client. |
Wow...thanks a lot! |
Have not tested it yet but looks promising, will post results when had the time do implement it :) |
Closing. Above solution is server specific, specific to Apollo, although seeing as response headers are a server construction, that is to be expected. |
Hello,
I have two graphql endpoints (authentiaction endpoint [AUTH] and application endpoint [APP]).
I created the api gateway using "makeRemoteExecutableSchema" and "introspectSchema".
The thing is that [AUTH] endpoint in login mutation returns a cookie:
The thing is, when I make a request directly to the [AUTH] endpoint, the cookie is set (I can see "Set-cookie" resposne headers). But when I make a login mutation via API gateway, the cookie is not set. How to solve my issue?
The text was updated successfully, but these errors were encountered: