Graphql-yoga: How to deploy on Google Cloud functions?

Created on 2 Apr 2018  路  9Comments  路  Source: dotansimha/graphql-yoga

There is only AWS lambda example.
How to deploy on Google or Firebase Cloud Functions?

kinquestion statupr-welcome

Most helpful comment

In Google Cloud Functions we can deploy Express application as a handler for function.
But all important parts of graphql-yoga are in start() function.
If split that to another function it's available to deploy on GCF and FCF.

Thanks.

All 9 comments

Great question! Would be great if someone would like to add an example containing deployment instructions in the corresponding readme.

In Google Cloud Functions we can deploy Express application as a handler for function.
But all important parts of graphql-yoga are in start() function.
If split that to another function it's available to deploy on GCF and FCF.

Thanks.

+1

Will be very useful

Hi, any updates ?

I've just tried simply deploying the AWS example on Google but it's crashing because a callback doesn't seem to be passed to the handlers:

2018-07-12T18:51:31.586861630Z: Function execution took 1243 ms, finished with status: 'crash'
2018-07-12T18:51:31.575Z: TypeError: callback is not a function
    at callbackFilter (/user_code/node_modules/graphql-yoga/dist/lambda.js:63:17)
    at Object.<anonymous> (/user_code/node_modules/apollo-server-lambda/dist/lambdaApollo.js:80:21)
    at step (/user_code/node_modules/apollo-server-lambda/dist/lambdaApollo.js:32:23)
    at Object.throw (/user_code/node_modules/apollo-server-lambda/dist/lambdaApollo.js:13:53)
    at rejected (/user_code/node_modules/apollo-server-lambda/dist/lambdaApollo.js:5:65)
    at process._tickDomainCallback (internal/process/next_tick.js:135:7)

Turns out Google functions will pass request and response to the HTTP handlers:

exports.server = (request, response) => { 
  lambda.graphqlHandler(...)
}

How can I call the graphql-yoga handler with these and send the response?

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

Hey :wave:, It seems like this issue has been inactive for some time. In need for maintaining clear overview of the issues concerning the latest version of graphql-yoga we'll close it.
Feel free to reopen it at any time if you believe we should futher discuss its content. :slightly_smiling_face:

@patrick-samy Did you figure out how to deploy graphql-yoga on firebase functions?

The interest thing is that it works on local... but its runs in 2 different ports.

can this be reopened?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bellomusodiq picture bellomusodiq  路  3Comments

checkmatez picture checkmatez  路  5Comments

anthonymetzler picture anthonymetzler  路  4Comments

SebastianEdwards picture SebastianEdwards  路  4Comments

asci picture asci  路  3Comments