diff --git a/server/core/views.py b/server/core/views.py index 06b86544..6c4b201f 100644 --- a/server/core/views.py +++ b/server/core/views.py @@ -1,4 +1,5 @@ from django.http.request import HttpRequest +from graphql import get_operation_ast, parse import requests from django.conf import settings from django.contrib.auth.mixins import LoginRequiredMixin @@ -22,11 +23,13 @@ class SentryGraphQLView(GraphQLView): operation_name, show_graphiql, ): - operation_type = ( - self.get_backend(request) - .document_from_string(self.schema, query) - .get_operation_type(operation_name) - ) + """ + adapted to use the new GraphQL 3.0 syntax, still need to get the operation type, + but the code to do this changed significantly, so the above link only explains + the 'what' and 'why', but no longer the 'how' + """ + document = parse(query) + operation_type = get_operation_ast(document, operation_name).operation with start_transaction(op=operation_type, name=operation_name): return super().execute_graphql_request( request, data, query, variables, operation_name, show_graphiql