graphene-gae icon indicating copy to clipboard operation
graphene-gae copied to clipboard

app.yaml handlers?

Open ppkn opened this issue 7 years ago • 1 comments
trafficstars

I'm pretty new to Google App Engine.

What do I need to add to the handlers section of app.yaml to make it work?

ppkn avatar Aug 07 '18 03:08 ppkn

You have to write your own WSGI application. https://github.com/graphql-python/graphene-gae/blob/master/tests/_webapp2/test_graphql_handler.py gives some hints.

eg mygraphql.py:

import webapp2
from graphene_gae.webapp2 import graphql_application, GraphQLHandler

[define query etc]
schema = graphene.Schema(query=QueryRoot)

graphql_application.config['graphql_schema'] = schema
graphql_application.config['graphql_pretty'] = True

application = webapp2.WSGIApplication([
        ('/graphql', GraphQLHandler)
    ])

then in app.yaml:

- url: /graphql
  script: mygraphql.application

mdornseif avatar Feb 04 '19 11:02 mdornseif