Adds GraphQL support to your WebPy application
Project description
[![Coverage Status](https://coveralls.io/repos/github/Igor-britecore/webpy-graphql/badge.svg?branch=master)](https://coveralls.io/github/Igor-britecore/webpy-graphql?branch=master)
Adds GraphQL support to your WebPy application.
Usage
Just use the GraphQLView view from webpy_graphql
from webpy_graphql import GraphQLView
urls = ("/graphql", "GQLGateway")
app = web.application(urls, globals())
class GQLGateway(BaseResponse):
view = GraphQLView('graphql', schema=GQLSchema, graphiql=True)
def GET(self):
return self.view.dispatch()
def POST(self):
return self.view.dispatch()
This will add /graphql endpoints to your app.
Supported options
schema: The GraphQLSchema object that you want the view to execute when it gets a valid request.
context: A value to pass as the context to the graphql() function.
root_value: The root_value you want to provide to executor.execute.
pretty: Whether or not you want the response to be pretty printed JSON.
executor: The Executor that you want to use to execute queries.
graphiql: If True, may present GraphiQL when loaded directly from a browser (a useful tool for debugging and exploration).
batch: Set the GraphQL view as batch (for using in Apollo-Client or ReactRelayNetworkLayer)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for WebPy_GraphQL-2.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 122471eb803e0ac611c843642bcd02ace50fea031007c4b3504d68c55a01f69b |
|
MD5 | 071d6cbc9de2ba978fff4e201137b4c9 |
|
BLAKE2b-256 | 3ed82a85d0cbf11fa8e36bca04b71b5a709115452c2bac68379d7894acc00bd9 |