Tag: graphene-django
-
Graphene-python performance issues for large data sets
20 The bounty expires in 3 days. Answers to this question are eligible for a +100 reputation bounty. pdoherty926 is looking for a canonical answer. Currently using graphene-python with graphene-django (and graphene-django-optimizer). After receiving a GraphQL query, the database query is successfully completed in a fraction of a second; however, graphene doesn’t send a response…
-
Graphene-python performance issues for large data sets
20 The bounty expires in 3 days. Answers to this question are eligible for a +100 reputation bounty. pdoherty926 is looking for a canonical answer. Currently using graphene-python with graphene-django (and graphene-django-optimizer). After receiving a GraphQL query, the database query is successfully completed in a fraction of a second; however, graphene doesn’t send a response…
-
GraphQL Queries Per App in Django (Graphene)
0 I started moving my REST API endpoints to using GraphQL with Graphene. Seems pretty straightforward so far, but one of the things that I like about the REST API (and I cannot figure out in Graphene) is the structure of "endpoints" for each app. I have a lot of apps in my Django application,…
-
Need to create checkout session GraphQL + Django
0 I need to create a session for Stripe Checkout. According to Stripe Checkout Docs: Add an endpoint on your server that creates a Checkout Session. A Checkout Session controls what your customer sees in the Stripe-hosted payment page such as line items, the order amount and currency, and acceptable payment methods. Return the Checkout…
-
import error ‘force_text’ from ‘django.utils.encoding’
49 I’m implementing a graphql solution using python, graphene and django and I’m getting the following import error: Result: Failure Exception: ImportError: cannot import name ‘force_text’ from ‘django.utils.encoding’ "/home/site/wwwroot/.python_packages/lib/site-packages/graphene_django/utils/utils.py", line 6, in <module> from django.utils.encoding import force_text I’m not sure about the versions and whether I need to import an additional module. My requirements.txt is…
-
How to Log Exceptions in Graphene-Python
0 I currently have my logging configured as follows: LOGGING = { "version": 1, "disable_existing_loggers": False, "formatters": { "default": { "format": "{levelname} {asctime} {process} {module}: {message}", "style": "{", }, }, "handlers": { "console": { "level": "DEBUG", "class": "logging.StreamHandler", "formatter": "default", } }, "loggers": { "server": {"handlers": ["console"], "level": "DEBUG"}, "django": {"handlers": ["console"], "level": "INFO"}, "graphql.execution.utils":…
-
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…
-
Graphene Django – How to add extensions to the response object
0 It’s fairly common practice in GraphQL to return custom data on an extensions field (Facebook use this for image prefetch URLs for example). I am trying to do this in Graphene, and have made an attempt to do this in execute_graphql_request. class CustomGraphQLView(GraphQLView): def execute_graphql_request(self, request, *args, **kwargs): result = super().execute_graphql_request(request, *args, **kwargs) result.extensions[‘a’]…
-
‘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,…