Skip to main content

Adds GraphQL support to your WebPy application

Project description

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_request()

    def POST(self):
        return self.view.dispatch_request()

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

WebPy_GraphQL-1.2.1-py2.py3-none-any.whl (9.3 kB view details)

Uploaded Python 2Python 3

WebPy_GraphQL-1.2.1-py2-none-any.whl (8.1 kB view details)

Uploaded Python 2

File details

Details for the file WebPy_GraphQL-1.2.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for WebPy_GraphQL-1.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9e30a926cbe3be71b1ba541c201720fc72d141daf5f1af95e41a3153c1b1b1fa
MD5 7fc5ff8b0eaf0438c3b8e6c315f5a208
BLAKE2b-256 d3db138164c5bf8354b40a2108a40927f77df2ce8ef389dd9361304ad2421c09

See more details on using hashes here.

File details

Details for the file WebPy_GraphQL-1.2.1-py2-none-any.whl.

File metadata

File hashes

Hashes for WebPy_GraphQL-1.2.1-py2-none-any.whl
Algorithm Hash digest
SHA256 f7955619333a65c136b4662fb6cd5251e3b5064430f63b1340647131fd4d68da
MD5 9f97283c12abf5469601ff5975913ca3
BLAKE2b-256 fd53cf65792f7105316967e90da2295af35c4239bb90a365b7c6fe3d37b6b94b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page