Skip to content

Instantly share code, notes, and snippets.

@sultaniman
Created October 31, 2018 21:11
Show Gist options
  • Select an option

  • Save sultaniman/0b6318071a21af66f87ca6f71928faaf to your computer and use it in GitHub Desktop.

Select an option

Save sultaniman/0b6318071a21af66f87ca6f71928faaf to your computer and use it in GitHub Desktop.
from typing import Any, Dict
from graphene_django.views import GraphQLView
from graphql.error import GraphQLError
from graph.format_error import format_error
class MyGraphQLView(GraphQLView):
@staticmethod
def format_error(error) -> Dict[str, Any]:
if isinstance(error, GraphQLError):
return format_error(error)
return GraphQLView.format_error(error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment