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
2
votes
1 answer

Unable to return Enum in GraphQL got Unhashable type: 'EnumMeta'

What I am trying to do I am trying to return Enum values with their names so if I run query: { getFruits { fruits } } I want the output: { data: { fruits: [ {APPLE: 1}, {ORANGE: 2}, {MANGO: 3} ] …
Ahtisham
  • 9,170
  • 4
  • 43
  • 57
2
votes
1 answer

How do I change relay connection limit in graphene django

In graphene-django I have a pagination limit set in my settings.py file like below. GRAPHENE = { 'RELAY_CONNECTION_MAX_LIMIT': 150, } Let's say a particular query returns 200 items (I don't know beforehand) and I want to display all of this…
chidimo
  • 2,684
  • 3
  • 32
  • 47
2
votes
1 answer

module 'jwt' has no attribute 'ExpiredSignature'

I have been developing a Django application using graphene/graphql running over AWS using Docker alpine image. I have been using django-grapql-jwt-0.3.1 module for calling jwt-2.0.0 authentication in my application. Where it is calling…
2
votes
2 answers

`op_name` parameter for `graphene_django`

The django graphene documentation shows a test example like this: class MyFancyTestCase(GraphQLTestCase): def test_some_query(self): response = self.query( ''' query { myModel { …
coler-j
  • 1,791
  • 1
  • 27
  • 57
2
votes
1 answer

Can the return type be transformed for a GraphQL resolver

I have a graphene-django GraphQL API that I've added custom directives and middleware in that are very similar to what's offered by graphene-django-extras. There are several places where enum types are returned as a graphene.Int() field, I'd like to…
geoffjay
  • 413
  • 4
  • 13
2
votes
1 answer

A simple query but Graphene-Django is returning null values

I am trying to make a simple query with graphene-django but i can not get the DB, it gives me null. I think the code is ok, what is going wrong, I am working for hours on it. Do you have any idea, what it is? Thanks in advance import graphene from…
Khan Khan
  • 119
  • 9
2
votes
0 answers

How to use async with Mutation in Django-graphene

I have a problem, where I want to optimise a client call to a mutation in a GraphQL API. The mutation executes 2 methods, where one is slow and where the result does not need to be send back to the client. I have tried to look at Django signals to…
munch
  • 21
  • 1
2
votes
1 answer

How to use MultipleChoiceFilter in graphene-django?

I have an Django application with graphql endpoint. I need the ability to filter objects at once by several values of a certain field. I have the following graphene Scheme: class ChannelFilter(FilterSet): type =…
2
votes
1 answer

graphene-django add additional argument for DjangoFilterConnectionField and pass it to get_queryset

I have added an additional argument called user_type to disposal_request query, and I want to use this argument to add another filter but when I passed it to get_queryset function. I get the following error: get_queryset() missing 1 required…
Ark Medes
  • 233
  • 1
  • 2
  • 9
2
votes
2 answers

Django GraphQL Test: How to test addition of new model fields?

I have a simple model as, class Person(models.Model): first_name = models.CharField(max_length=20) and I have setup the GraphQL to query the data, import graphene import graphene_django from .models import Person class…
JPG
  • 82,442
  • 19
  • 127
  • 206
2
votes
1 answer

How to use Relay's pagination feature with filterset_class from django-filter when using graphene-django

I've a Django project where I'm using django-graphene to create a GraphQL API. There's an issue when trying to use DjangoFilterConnectionField together with the relay.Connection (which is the core of pagination's feature) My model is too large and…
Cristian Rojas
  • 2,746
  • 7
  • 33
  • 42
2
votes
1 answer

Graphene-django - Mutating types with enums

So, I have the following model: class Semester(models.Model): course = models.ManyToManyField(Course, through='CourseSemester') class SemesterType(models.TextChoices): A = 'A', 'Winter' B = 'B', 'Spring' SUMMER =…
Liel Fridman
  • 1,019
  • 7
  • 11
2
votes
0 answers

How can we add authorization for graphql api in Django graphene?

I am using React Native as client and Django Graphene at Backend.Also i am using django-graphql-auth for login. I am getting token and refresh token from tokenAuth mutation. But currently if anyone knows my mutation or query along with graphql end…
2
votes
0 answers

How can I just update one field at the time using mutation? graphene-django

Here's the code I wrote to update my task class UpdateTask(graphene.Mutation): class Input: id = graphene.ID() description = graphene.String(required=False) completed = graphene.Boolean() task =…
2
votes
2 answers

WebSocket connection to 'wss://api-such.andsuch.xyz/graphql/' failed: Error during WebSocket handshake: Unexpected response code: 400

I recently deployed a project I'm working on to production. I use DjangoChannelsGraphqlWs for GraphQL subscription functionalities. and I have GraphQL Playground set up via django-graphql-playground. Everything works fine locally - there are no…