from django.contrib import admin
from django.urls import path
from django.views.decorators.csrf import csrf_exempt
from .views import PublicGraphQLView, UserGraphQLView, TeamGraphQLView, M2MGraphQLView
from .schemas.public_schema import public_schema
from .schemas.user_schema import user_schema
from .schemas.team_schema import team_schema
from .schemas.m2m_schema import m2m_schema

urlpatterns = [
    path('admin/', admin.site.urls),
    path('graphql/public/', csrf_exempt(PublicGraphQLView.as_view(graphiql=True, schema=public_schema))),
    path('graphql/user/', csrf_exempt(UserGraphQLView.as_view(graphiql=True, schema=user_schema))),
    path('graphql/team/', csrf_exempt(TeamGraphQLView.as_view(graphiql=True, schema=team_schema))),
    path('graphql/m2m/', csrf_exempt(M2MGraphQLView.as_view(graphiql=True, schema=m2m_schema))),
]
