On this page

Integration with Google Cloud Platform

GraphQL Yoga v3 documentation (superseded by v5): Google Cloud Platform (GCP) is a suite of cloud computing services powered by Google. It is easy to use GraphQL Yoga with GCP.

Google Cloud Platform (GCP) is a suite of cloud computing services powered by Google. It is easy to use GraphQL Yoga with GCP.

Installation

npm i graphql
npm i graphql-yoga

Usage

import { createSchema, createYoga } from 'graphql-yoga'

export const graphql = createYoga({
  schema: createSchema({
    typeDefs: /* GraphQL */ `
      type Query {
        greetings: String
      }
    `,
    resolvers: {
      Query: {
        greetings: () => 'This is the `greetings` field of the root `Query` type'
      }
    }
  }),
  graphqlEndpoint: '*'
})

You can also check a full example on our GitHub repository here