Skip to content

Commit

Permalink
Added support for Quiver
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Jun 13, 2018
1 parent 3693378 commit 5d92929
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion swapi_graphene/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,24 @@
from graphene_django.views import GraphQLView
from starwars.schema import schema

from graphql import GraphQLDeciderBackend, GraphQLCachedBackend, GraphQLCoreBackend
from graphql.backend.quiver_cloud import GraphQLQuiverCloudBackend

# Hack for allow static files in prod (Heroku/Dokku)
def static(prefix, view=serve, **kwargs):
return [
url(r'^%s(?P<path>.*)$' % re.escape(prefix.lstrip('/')), view, kwargs=kwargs),
]

backend = GraphQLDeciderBackend([
# GraphQLCachedBackend(GraphQLQuiverCloudBackend(
# 'https://******@api.graphql-quiver.com'
# )),
GraphQLCoreBackend()
])

urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url('', include('starwars.urls')),
url(r'^graphql', GraphQLView.as_view(graphiql=True)),
url(r'^graphql', GraphQLView.as_view(graphiql=True, backend=backend)),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

0 comments on commit 5d92929

Please sign in to comment.