A hello-world GraphQL function deployed on Cloudflare Workers, AWS Lambda, Azure Functions, and Google Cloud Functions.
const { gql, ApolloServer } = require('apollo-server-${platform}')
const typeDefs = gql`
type Query {
hello: String
}
`
const resolvers = {
Query: {
hello: () => 'Hello world!',
},
}
const server = new ApolloServer({
typeDefs,
resolvers,
introspection: true,
})
// Platform-specific handler
// e.g. module.exports.graphql = server.createHandler()
Results are collected from each provider's logs, execution times are based on what the platform reports.
- Run
serverless deploy
(orwrangler publish
for Cloudflare Workers) - Run
artillery run benchmark.yml
to run various benchmarking tests - Go to the provider's logging system and export the execution times (this will be different for every platform)
- Compare the results!