Move GraphQL to separata app

This commit is contained in:
Lukáš Kucharczyk 2023-11-29 21:04:35 +01:00
parent 5ef8c07f30
commit cb380814a7
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
9 changed files with 26 additions and 7 deletions

0
api/__init__.py Normal file
View File

3
api/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
api/apps.py Normal file
View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class ApiConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "api"

View File

3
api/models.py Normal file
View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@ -1,12 +1,12 @@
import graphene
from graphene_django import DjangoObjectType
from .models import Device as DeviceModel
from .models import Edition as EditionModel
from .models import Game as GameModel
from .models import Platform as PlatformModel
from .models import Purchase as PurchaseModel
from .models import Session as SessionModel
from games.models import Device as DeviceModel
from games.models import Edition as EditionModel
from games.models import Game as GameModel
from games.models import Platform as PlatformModel
from games.models import Purchase as PurchaseModel
from games.models import Session as SessionModel
class Game(DjangoObjectType):

3
api/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
api/views.py Normal file
View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View File

@ -33,6 +33,7 @@ ALLOWED_HOSTS = ["*"]
INSTALLED_APPS = [
"games.apps.GamesConfig",
"api.apps.ApiConfig",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
@ -41,7 +42,7 @@ INSTALLED_APPS = [
"graphene_django",
]
GRAPHENE = {"SCHEMA": "games.schema.schema"}
GRAPHENE = {"SCHEMA": "api.schema.schema"}
if DEBUG:
INSTALLED_APPS.append("django_extensions")