Skip to content

Latest commit

History

History

gcp-functions-graphql

Folders and files

NameName
Last commit message
Last commit date

parent directory

..

GraphQL Server on Google Cloud Functions

Host a GraphQL Server on Google Cloud Functions by routing requests through the apollo-sever-express package.

This method is markedly simpler than any other GraphQL-on-FaaS method I have seen. No custom packages for GCP or struggling with API Gateway or complex setup instructions for AWS.

Babel is used to compile to the target runtime, for more information on this setup read Babel & preset-env & ES6+ in Cloud Functions for Firebase #2

Routes

Endpoint Route
Schema https://us-central1-<project-name>.cloudfunctions.net/api/schema
GraphiQL https://us-central1-<project-name>.cloudfunctions.net/api/graphiql
GraphQL https://us-central1-<project-name>.cloudfunctions.net/api/graphql?<query>

Setup the Cloud SDK

You should be prompt by the Cloud SDK to select your GCP project at this step.


## Deploy to Google Cloud Functions

```shell
yarn deploy