How to use the graphql-playground-middleware-lambda.default function in graphql-playground-middleware-lambda

To help you get started, we’ve selected a few graphql-playground-middleware-lambda examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prisma-labs / graphql-playground / packages / graphql-playground-middleware-lambda / examples / basic / handler.js View on Github external
}

exports.graphqlHandler = function graphqlHandler(event, context, callback) {
  function callbackFilter(error, output) {
    // eslint-disable-next-line no-param-reassign
    output.headers['Access-Control-Allow-Origin'] = '*'
    callback(error, output)
  }

  const myGraphQLSchema = makeExecutableSchema({ typeDefs, resolvers })

  const handler = graphqlLambda({ schema: myGraphQLSchema })
  return handler(event, context, callbackFilter)
}

exports.playgroundHandler = lambdaPlayground({
   endpoint: '/dev',
})

graphql-playground-middleware-lambda

GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).

MIT
Latest version published 3 years ago

Package Health Score

62 / 100
Full package analysis

Popular graphql-playground-middleware-lambda functions