Skip to content

Commit

Permalink
fix: Move some graphl imports to inside methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tOgg1 committed Dec 30, 2020
1 parent bd4dbd6 commit 1037259
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions django_scoped_permissions/graphql_util.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import itertools
import re
from typing import Mapping, Iterable, List
from typing import Mapping, Iterable
from django_scoped_permissions.models import ScopedModel

from graphql import GraphQLError
from pydash import get

from django_scoped_permissions.models import ScopedModel


def create_resolver_from_method(field_name, method):
from graphql import GraphQLError
def resolver(object, info, **args):
if not method(object, info, **args):
raise GraphQLError("You are not permitted to view this.")
Expand All @@ -19,6 +18,7 @@ def resolver(object, info, **args):


def create_resolver_from_scopes(field_name: str, scopes: [str]):
from graphql import GraphQLError
def resolver(object, info, **args):

user = info.context.user
Expand Down

0 comments on commit 1037259

Please sign in to comment.