I’ve been working with the severless deploy lately trying migrate my API side to it rather than using netlify functions. The issue I’m trying to solve atm is that CORS settings is not respected for the Auth/current user query, this one
query __REDWOOD__AUTH_GET_CURRENT_USER { redwood { currentUser } }
Where as other graphql queries work (same function)
Using curl I can see this query does not have CORS hearders, but some of my other queries DO have cors headers.
I’m guessing because the auth is a plugin instead of a user server that it follows a different code path and that’s where the issue comes in. I’ve done a little digging and I added some logging to log out lambdaResponse in packages/graphql-server/src/functions/graphql.ts in the frame work, than deployed it to see if that would illuminate anything and I’m just as confused. for the above query the lambdaResponse is
{
body: '{"data":{"redwood":{"currentUser":null}}}',
statusCode: 200,
headers: {
'access-control-allow-credentials': 'true',
'access-control-allow-origin': '*'
}
}
So it seems these headers are there being ignored but only for this query?
I’m happy to continue digging into this, but not sure where else to look in the framework?