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 graphql-yogaUsage
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 (opens in a new tab)