Graphql-django-view

Latest version: v1.4

Safety actively analyzes 685525 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

1.1.1

Changelog
- Added UTF-8 support
- Added support for `multipart/form-data`
- Fixed tests
- Updated GraphQL-core dependency min version

1.0.0

Initial API stable release:

A `django` view that will execute a `GraphQLSchema` using a given `Executor`.

Usage

Use it like you would any other Django View.

python
urlpatterns = [
url(r'^graphql', GraphQLView.as_view(schema=Schema)),
]


Supported options
- `schema`: The `GraphQLSchema` object that you want the view to execute when it gets a valid request.
- `pretty`: Whether or not you want the response to be pretty printed JSON.
- `executor`: The `Executor` that you want to use to execute queries.
- `root_value`: The `root_value` you want to provide to `executor.execute`.

You can also subclass `GraphQLView` and overwrite `get_root_value(self, request)` to have a dynamic root value
per request.

python
class UserRootValue(GraphQLView):
def get_root_value(self, request):
return request.user

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.