Skip to content

Commit f469898

Browse files
authored
Merge pull request #11 from Sakshijain12/main
Added Graphene as a Dependency
2 parents 154212c + fe8af59 commit f469898

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

backend/family_tree/family_tree/settings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
# Application definition
3232

3333
INSTALLED_APPS = [
34+
"django.contrib.staticfiles",
35+
"graphene_django",
3436
'django.contrib.admin',
3537
'django.contrib.auth',
3638
'django.contrib.contenttypes',
@@ -123,3 +125,7 @@
123125
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
124126

125127
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
128+
129+
GRAPHENE = {
130+
"SCHEMA": "django_root.schema.schema"
131+
}

backend/family_tree/family_tree/urls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
"""
1616
from django.contrib import admin
1717
from django.urls import path
18+
from graphene_django.views import GraphQLView
1819

1920
urlpatterns = [
2021
path('admin/', admin.site.urls),
22+
path("graphql", GraphQLView.as_view(graphiql=True)),
2123
]

backend/family_tree/schema.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import graphene
2+
3+
class Query(graphene.ObjectType):
4+
hello = graphene.String(default_value="Hi!")
5+
6+
schema = graphene.Schema(query=Query)

0 commit comments

Comments
 (0)