Skip to content

Latest commit

 

History

History

functions-graphql-apollo

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Apollo GraphQL & Cloud Functions for Firebase

Cloud Functions can accept an Express.js server as it's params as they share a similar request/response object (as discussed here). Using the apollo-server-express package we can quickly and easily setup a GraphQL server on FaaS.

The accompanying Medium post.

Install & Run

# Install
yarn
# Locally serve
yarn serve
# Deploy
yarn deploy

Routes

GraphQL Playground: https://us-central1-<project-id>.cloudfunctions.net/api

GraphQL Endpoint: https://us-central1-<project-id>.cloudfunctions.net/api/graphql

Use

Go to the GraphQL Playground route and enter the GraphQL endpoint route into the GraphQL Server address bar to connect the playground to your endpoint. Now you can query away and develop your app!

Here's the test query:

{
  hello
}