Skip to content

Commit

Permalink
removing graphql from the python API
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanNoelk committed Feb 2, 2018
1 parent 3489c8f commit becd84d
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 783 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ ENV PYTHONUNBUFFERED 1
RUN apk update && apk upgrade && \
apk add --no-cache \
gcc \
git \
openssh \
mariadb \
mariadb-dev \
py-mysqldb \
Expand Down
41 changes: 0 additions & 41 deletions base/graphql.py

This file was deleted.

4 changes: 0 additions & 4 deletions base/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,3 @@ Pillow==2.7.0
mysqlclient==1.3.12
mock==2.0.0
pytz==2016.10

# graphene-django==1.3
git+https://github.com/graphql-python/graphene-django.git@2929d0866c800ae6efa8d35bb40548940a70c31f
graphene==1.4.1
8 changes: 0 additions & 8 deletions base/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,6 @@
'corsheaders'
)

# Where your Graphene schema lives
GRAPHENE = {
'SCHEMA': 'base.graphql.schema',
'MIDDLEWARE': (
'graphene_django.debug.DjangoDebugMiddleware',
)
}

# Password validation
# https://docs.djangoproject.com/en/2.0/topics/auth/passwords/#password-validation
AUTH_PASSWORD_VALIDATORS = [
Expand Down
30 changes: 0 additions & 30 deletions base/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,6 @@
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views.decorators.csrf import csrf_exempt
from rest_framework.permissions import IsAuthenticated
from rest_framework.decorators import authentication_classes, permission_classes, api_view
from rest_framework.settings import api_settings
from rest_framework.request import Request
from graphene_django.views import GraphQLView


class DRFAuthenticatedGraphQLView(GraphQLView):
def parse_body(self, request):
if isinstance(request, Request):
return request.data
return super(GraphQLView, self).parse_body(request)

@classmethod
def as_view(cls, *args, **kwargs):
view = super(GraphQLView, cls).as_view(*args, **kwargs)
view = permission_classes((IsAuthenticated,))(view)
view = authentication_classes(api_settings.DEFAULT_AUTHENTICATION_CLASSES)(view)
view = api_view(['GET', 'POST'])(view)
return view


admin.autodiscover()

Expand All @@ -36,18 +14,10 @@ def as_view(cls, *args, **kwargs):
path('api/v1/', include('v1.urls', namespace='v1')),
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),

# GraphQL
path('graphql/', csrf_exempt(DRFAuthenticatedGraphQLView.as_view())),

# Generic Static Home
path('', TemplateView.as_view(template_name='index.html'), name='home'),

# Admin
path('admin/', admin.site.urls),

] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

if settings.DEBUG:
urlpatterns += [
path('graphiql/', csrf_exempt(GraphQLView.as_view(graphiql=True)))
]
94 changes: 0 additions & 94 deletions v1/common/deletion.py

This file was deleted.

19 changes: 0 additions & 19 deletions v1/common/list_scalar.py

This file was deleted.

18 changes: 0 additions & 18 deletions v1/common/total_count.py

This file was deleted.

Loading

0 comments on commit becd84d

Please sign in to comment.