Hi there,
I have set up an Apollo Sandbox (@apollo/server 4.9.3) for my NestJS GraphQL endpoint (https://docs.nestjs.com/graphql/quick-start#apollo-sandbox).
This all works nicely. However, there is a login button shown on the top right which initiates an authentication workflow with my GitHub account in a new tab: https://studio.apollographql.com/embed-authentication?embedSubdomain=sandbox&origin=mydomain&type=sandbox
When I click on “Authorize”, I get an error:
EmbedAuthenticator.tsx:78 Uncaught (in promise) TypeError: Cannot read properties of null (reading ‘postMessage’)
at onCompleted (EmbedAuthenticator.tsx:78:25)
at useMutation.js:63:71
It sent a POST request to https://graphql.api.apollographql.com/api/graphql which was successful:
{
"data": {
"me": {
"newKey": {
"id": "myid",
"token": "user:gh.xyz",
"__typename": "UserApiKey"
},
"__typename": "UserMutation"
}
}
}
Is this a bug in the authentication workflow or is the login process not supposed to work with the Apollo Sandbox as part of my NestJS app (param origin
is set to the NestJS app’s domain but probably it does not respond to the request correctly, resulting in the error message)?
If so, is there a way to deactivate the login in my Apollo sandbox?
Thanks for your feedback.