Questions tagged [graphene-django]

Use this tag for questions about Graphene-Django, integration features of Graphene (a framework for building GraphQL APIs) that are designed to make working with Django simple.

386 questions
0
votes
1 answer

Can't access nested dictionary data **kwargs python and best practices for nested data mutation in GraphQL

In Graphene-Django and GraphQL I am trying to create a resolve_or_create method for nested data creation inside my mutations. I'm trying to pass a dictionary with the input from the user as a **kwarg to my resolve_or_create function, and though I…
Joe Howard
  • 307
  • 5
  • 27
0
votes
1 answer

How can I restrict who has access to the GraphiQL API browser with graphene-django?

Graphene-Django docs note that you can pass graphiql=False when instantiating the GraphQLView if you do not want to use the GraphiQL API browser. However, I'd like to keep the GraphiQL API browser available, and merely restrict who has access to it.…
Steven D.
  • 493
  • 4
  • 12
0
votes
0 answers

How to Filter on Related Model Count in Graphene Django

I have 2 models: import uuid from django.db import models class Country(models.Model): name = models.CharField(max_length=255, unique=True) def city_count(self): return self.city_set.count() class City(models.Model): country…
damusnet
  • 4,320
  • 3
  • 25
  • 39
0
votes
2 answers

Mitigate heavy django graphene request with ajax polling

I have some queries I am making that cause timeouts. Because the computing of the data takes too long on the server in some very specific edge cases. What is the best solution for my specific stack? I was thinking of polling the server every 20…
anthony-dandrea
  • 2,583
  • 7
  • 26
  • 46
0
votes
1 answer

React Native Apollo + Django: Network Request Failed

I'm very new to programming and couldn't understand how my react native expo app isn't fetching data from my Django server (which is running). How can I resolve this? I've got graphene-django running at the back. Here's my App.js Network Error:…
0
votes
1 answer

Django graphen Create Mution fireing Error

These are my schmema import graphene from graphene import relay, ObjectType, Mutation from graphene_django import DjangoObjectType from graphene_django.filter import DjangoFilterConnectionField from cookbook.models import Ingredient class…
user12551055
0
votes
1 answer

Question about graphene-django mutation documentation

While I've been able to make my application work, I have some concerns about doing things the right way. Therefore there is something I "do not understand" : In the documentation, here, in the QuestionMutation class, there is a question attribute.…
lbris
  • 1,068
  • 11
  • 34
0
votes
1 answer

Can I nest similar model relationships under a custom type in Graphene Django?

Assuming I have a Django model with a number of relationships that are related, is it possible to nest them through a non-model type for querying purposes? A specific example: Assume I have a model Organization with relationships that include…
Matt Sanders
  • 8,023
  • 3
  • 37
  • 49
0
votes
1 answer

Need to create checkout session GraphQL + Django

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…
0
votes
4 answers

Django + Graphene, after registering a user, a confirmation letter has arrived in the developer's console. How can I get control of this email?

I am learning Django + Graphene + React(Apollo), after registering a user, a confirmation email has come to the developer console. How can I get control of this email? class AuthMutation(graphene.ObjectType): register =…
Murlodin
  • 21
  • 1
  • 6
0
votes
1 answer

Graphen Django: Batch requests should receive a list, but received {'query': XXX}

I have enabled the batch query processing functionality in Graphene-Django by adding batch=True to the .as_view(...) method as, urlpatterns = [ # other URL patterns, path('graphql/', CustomGraphQLView.as_view(schema=schema, batch=True),…
JPG
  • 82,442
  • 19
  • 127
  • 206
0
votes
1 answer

Graphene creates unique ids

Here in relay tutorial they say: Graphene creates globally unique IDs for all objects. You may need to copy this value from the results of the first query Those ids look like this SW5ncmVkaWVudE5vZGU6MQ==. And when querying a list of item in id…
0
votes
2 answers

How to use a django abstract class with graphene-django?

I'm trying to have a unique interface for two concrete classes that are similar and inherit from a common abstract class. My django model classes: class Metadata(models.Model): name = models.CharField(max_length=255) sequence =…
Cyrille Pontvieux
  • 2,356
  • 1
  • 21
  • 29
0
votes
1 answer

How to return two different error messages when querying the same model in Django

Take a look at the following: def mutate(self, info, first_id, second_id): try: first = Model.objects.get(pk=first_id) second = Model.objects.get(pk=second_id) except Model.DoesNotExist: return Exception('Object does…
Caspian
  • 633
  • 1
  • 10
  • 29
0
votes
1 answer

Is django-filter FilterSet behavior consistent with native Django behavior for queries spanning multi-valued relationships?

I’m trying to query all unread messages for a user via the recipient model (i.e. each message has many recipients with a read property). The query works as expected when run with the model manager. For…
lgants
  • 3,665
  • 3
  • 22
  • 33