⚠️
This is the documentation for the old GraphQL Yoga version 3. We recommend upgrading to the latest GraphQL Yoga version 5.
Migrate to GraphQL Yoga v5
Migrate to GraphQL Yoga v5
Integration with Google Cloud Platform
Google Cloud Platform (GCP) is a suite of cloud computing services powered by Google. It is easy to use GraphQL Yoga with GCP.
Installation
Terminal
yarn add graphql
yarn add 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: '*'
})
💡
This example uses ESM syntax, so you set "type": "module"
in your
package.json
.
You can also check a full example on our GitHub repository here