Skip to main content

Adds GraphQL support to your WebOb (Pyramid/Pylons/...) application

Project description

Build Status Coverage Status PyPI version

Adds GraphQL support to your WebOb (Pyramid, Pylons, …) application.


For instaling WebOb-GraphQL, just run this command in your shell

pip install "webob-graphql>"


Just use the serve_graphql_request function from webob_graphql


from pyramid.view import view_config

from webob_graphql import serve_graphql_request

    # The serve_graphql_request method will detect what's the best renderer
    # to use, so it will do the json render automatically.
    # In summary, don't use the renderer='json' here :)
def graphql_view(request):
    return serve_graphql_request(request, schema)

    # Optional, for adding batch query support (used in Apollo-Client)
    return serve_graphql_request(request, schema, batch_enabled=True)

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.
  • format_error: If you want to use a custom error formatter.
  • 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_enabled: If True (default), may present GraphiQL when loaded directly from a browser (a useful tool for debugging and exploration).
  • render_graphiql: A custom function for rendering GraphiQL (this function should have the arguments result and params).
  • batch_enabled: Enable batch support (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.

Files for WebOb-GraphQL, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size WebOb-GraphQL-1.0.tar.gz (7.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page