Tag: django
-
How can I use django-filter’s DateTimeFromToRangeFilter with Graphene?
0 I’m attempting to use an instance of django-filter’s DateTimeFromToRangeFilter in conjunction with a custom FilterSet. However, this does not work when I attempt to do the following: class CustomFilterSet(FilterSet): modified = django_filters.IsoDateTimeFromToRangeFilter() class Meta: fields = "__all__" model = Custom This does not result in additional fields or annotations being created, like I’d expect…
-
Django Graphql Auth mutations failing with error unexpected keyword argument ‘refresh_token’
0 In my project I am using below libraries for django graphql authentication, django-graphql-jwt django-graphql-auth PyJWT I am running below mutation and some other similar mutations. mutation Register { register( email: "[email protected]" password1: "Abcd@2023" password2: "Abcd@2023" ) { success errors refreshToken token } } From yesterday suddenly all mutations started failing with error, { "errors":…
-
‘function’ object has no attribute ‘__func__’ issue with graphene django
0 TypeError: UserProcessOptionsNode fields cannot be resolved. ‘function’ object has no attribute ‘__func__’ class UserProcessOptionsNode(DjangoObjectType): client_configuration = GenericScalar() class Meta: model = api_models.UserProcessOptions interfaces = (relay.Node,) filter_fields = ("user",) @classmethod def get_queryset(cls, queryset, info): user_list = [] user_list.append(info.context.user) user_list.append(info.context.user.parent_user) userprocess = queryset.filter(user__in=user_list) return userprocess This issue is caused when I upgrade graphene-django from 2.15.0 to…
-
Django app stopped working after installing django-graphql-auth
-2 I was working on a Django application with GraphQL. I installed few required libraries. Everything seems to be working fine until I installed django-graphql-auth. Immediately after installing that, I’m getting below error. /Users/sukumar/IntellijProjects/venvs/plotcare_be/bin/python manage.py runserver Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): File "/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 932,…
-
How to hide django default filters from others except admin user?
1 I have below User graphql API endpoint in my application. Query class Query(UserQuery, graphene.ObjectType): all_users = DjangoFilterConnectionField( UserType, filterset_class=UserFilter) Type class UserType(DjangoObjectType): class Meta: model = User fields = "__all__" interfaces = (graphene.relay.Node,) Filter class UserFilter(FilterSet): user_name_search = CharFilter( method=’user_name_filter’, label=’User Name Search’ ) class Meta: model = User fields = [ ‘user_name_search’, ‘user_id’,…
-
user match query does not exist
0 I have been tasked to create separate user model for third_party users who are to access our endpoint so i created separate user named ApiCliet and inherited the Abstract user model of Django i also created a custom authentication for that user model only and then crated two mutation to create an api client…
-
Django – working example of graphene aiodataloader
0 I’ve been looking into using a DataLoader in Django to optimise Graphene resolvers. I have been having trouble finding a working example of this as it requires multi threading. Based on what I can tell, there is no longer a way to specify executors in the latest versions of GraphQL in python. Does anyone…