GraphQL-python-archive / graphql-django-view

[DEPRECATED | Use graphene-django package] A django view that will execute a GraphQLSchema using a given Executor.
http://graphene-python.org/
MIT License
23 stars 7 forks source link

graphql-django-view

Build Status Coverage Status PyPI version

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

Usage

Use it like you would any other Django View.

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

Supported options

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

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