Graphql-yoga: Document options for GraphQLServerLambda, specifically cors

Created on 4 May 2018  路  8Comments  路  Source: dotansimha/graphql-yoga

There 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.

kinquestion statustale

All 8 comments

This is what's currently preventing me from deploying to Lambda. 馃憤

If you are using typescript, you will see that there is no cors option.

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

Hey :wave:, 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. :slightly_smiling_face:

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

nono mr stale pls don't I think this is important!

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

Hey :wave:, 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. :slightly_smiling_face:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bellomusodiq picture bellomusodiq  路  3Comments

frederikhors picture frederikhors  路  4Comments

AhmadEl-Banna picture AhmadEl-Banna  路  5Comments

ramonmulia picture ramonmulia  路  3Comments

cj picture cj  路  3Comments