Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Build Status Coverage Status PyPI version

Adds GraphQL support to your WebOb application.

Usage

Just use the serve_graphql_request function from webob_graphql

Pyramid

from pyramid.view import view_config

from webob_graphql import serve_graphql_request


@view_config(
    route_name='graphql',
    # 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)

Metadata

Release files for WebOb-GraphQL 1.0.dev20170404001

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for WebOb-GraphQL 1.0.dev20170404001
File Size Uploaded
WebOb-GraphQL-1.0.dev20170404001.tar.gz 7.1 kB Details

Release files / WebOb-GraphQL-1.0.dev20170404001.tar.gz

Download URL WebOb-GraphQL-1.0.dev20170404001.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
28401d9b88b8d92a999e96efede784e29a8783525cbe478a2fa0c9315884fd82
BLAKE2b-256 checksum
How to use checksums
8093b0cf39ff70b61a572cab64e47ebc37b1687d8496f16f2f42cf2616490a81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.0

1 release file

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page