Document options for GraphQLServerLambda, specifically cors
See original GitHub issueThere have been quite a few questions about configuring cors
with graphql-yoga
, especially when using GraphQLServerLambda
(example with more context).
Does the following work?
const options = {
cors: {
'origin': ['http://localhost:8080/'],
'methods': ['GET', 'HEAD', 'POST'],
'preflightContinue': false,
'optionsSuccessStatus': 200
}
}
lambda = new GraphQLServerLambda({
options,
schema,
})
exports.server = lambda.graphqlHandler
If so, this should be properly documented. If not, this should be added as a feature.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:8
Top Results From Across the Web
Configuring CORS - Apollo GraphQL Docs
CORS uses specific HTTP response headers as part of its protocol, including Access-Control-Allow-Origin . ... Configuring CORS options for Apollo Server.
Read more >Document options for GraphQLServerLambda, specifically cors
There have been quite a few questions about configuring cors with graphql-yoga, especially when using GraphQLServerLambda (example with more context).
Read more >How to enable cors for apollo-server-lambda - Stack Overflow
Following the CORS setup instructions here I can successfully use apollo-angular to return results for a simple query.
Read more >@pythonit/apollo-server-lambda-with-cors-regex - npm
This will look for a file called graphql.js with the export graphqlHandler . It creates one API endpoints: /graphql (GET and POST). In...
Read more >CORS – GraphQL Yoga
For example, if your web client is deployed to example.com but your Yoga server is api.example.com. For security reasons your browser will not ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Due to inactivity of this issue we have marked it
stale
. It will be closed if no further activity occurs.Hey 👋, It seems like this issue has been inactive for some time. In need for maintaining clear overview of the issues concerning the latest version of
graphql-yoga
we’ll close it. Feel free to reopen it at any time if you believe we should futher discuss its content. 🙂