Search code examples
node.jsgoogle-app-enginegraphqlgoogle-cloud-sqlapollo-server

How to properly configure apollo graphql + node.js to google app engine


I am trying to deploy a node + apollo server to google app engine so that I can call https://appspot/graphql. But I don't know how to achieve this.
https://localhost:8080/graphql runs successfully locally. I can use as endpoint to query. But https://appspot/graphql gives "GET query missing". file

enter image description here file

enter image description here

Problem solved by add playground:true, introspection: true to ApolloServer. Also whitelist all network.


Solution

  • I have not seen property any modules property, in Apollo Server config.

    This is how I have setup my Apollo server:

    const server = new ApolloServer({
                schema: mySchema, //This contains my consolidate schema, for a basic 
                                  //setup, it can be an object containing typedefs 
                                  // and resolvers or 
                                  //complex schema.
                context: context,  
                playground: {       //if we want to keep the playground on in 
                                    //Production. By default it is disabled.
                    enabled: true,
                    settings: {
                      "request.credentials": "include"
                    }
                }
    });
    

    Moreover we need to provide path like following:

    server.applyMiddleware({ app, path: '/somepath' });
    

    So if you are looking run your server at some path then, it can be setup like above.