Guest User

Untitled

a guest
Dec 14th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. from django.conf.urls import url
  2. from graphene import Schema, ObjectType, Int, Field
  3. from graphene_django.views import GraphQLView
  4.  
  5.  
  6. class Query(ObjectType):
  7. health_level = Field(Int)
  8.  
  9. def resolve_health_level(self, args, context, info):
  10. return 9999
  11.  
  12.  
  13. schema = Schema(query=Query)
  14.  
  15.  
  16. urlpatterns = [
  17. url(r'^graphql', GraphQLView.as_view(schema=schema, graphiql=True))
  18. ]
Add Comment
Please, Sign In to add comment