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.
Questions tagged [graphene-django]
386 questions
0
votes
1 answer
GraphQL-"Unknown argument \"country\" on field \"allNews\" of type \"Query\".",
GraphQL newbie here. So I was trying to write a schema in Django using graphene which will take country parameter as a String & time parameter as Character. The query works fine with the "time" parameter, but whenever I add the "country" param. it…

Proteeti Prova
- 1,079
- 4
- 25
- 49
0
votes
2 answers
Full media absolute paths with graphene-django
I'm currently switching from using DRF to django-graphene while using boto3 and s3 for media content. When using DRF, the file field would come back with the full path for the media inside of the s3 bucket. However, graphene-django file fields are…

user133688
- 6,864
- 3
- 20
- 36
0
votes
1 answer
Testing Django GraphQL API with database
I am using
from graphene_django.utils.testing import GraphQLTestCase
to implement my tests. However, the result from
class PeopleTests(GraphQLTestCase):
GRAPHQL_SCHEMA = schema
def test_all_person_query_admin_token(self):
response =…

bwright
- 896
- 11
- 29
0
votes
1 answer
How to filter with graphene.filter
I want to filter Notifications by user.username, how can I do it?
models.py
class Notification(BaseModelo):
user = models.ForeignKey(User, on_delete=models.CASCADE)
text = models.CharField(max_length=200)
state =…

Raúl C. Rivero
- 307
- 1
- 4
- 20
0
votes
1 answer
Graphene Returning NoneType Error on Subscription
I'm trying to setup subscription on graphene-django and channels using channels_graphql_ws.
I'm getting the following error when trying to run my subscription query:
An error occurred while resolving field Subscription.onNewComment
Traceback (most…

morinx
- 635
- 7
- 19
0
votes
1 answer
GraphQL AttributeError: module 'graphene' has no attribute 'Heroes'
i am a beginner with Django & GraphQL, i had a problem the at first step, i can not reach to GraphiQL, i had an error
Could not import 'traindjango.schema.schema' for Graphene setting 'SCHEMA'.
AttributeError: module 'graphene' has no attribute…

Lukas
- 1
- 1
0
votes
1 answer
I am trying to create a graphql mutation , where i cannot add the categoryNode as a input feild to AddEquipment mutation
category model
this my category model
class Category(models.Model):
_id = models.ObjectIdField(primary_key=True)
name = models.CharField(max_length=100)
Category node
I've created a category node using relay
class…

Ram prasanth
- 3
- 2
0
votes
1 answer
django_graphene looking for package "six" in the wrong place?
I'm trying to use graphene-django, and a having some issues with the "six" package. It's installed, but it's installed as its own package, and graphene-django seems to be expecting it under django.utils
File…

michjnich
- 2,796
- 3
- 15
- 31
0
votes
1 answer
How to get results in the right way with Graphql
I'm using Graphene in Django as a backend.
I have Query as follows:
class Query(object):
constructor_info = graphene.Field(UnTypedDataType, vin=graphene.String(required=True))
def resolve_constructor_info(self, info, **kwargs):
vin =…

Boky
- 11,554
- 28
- 93
- 163
0
votes
1 answer
graphene mutation returns 400 - won't pass id field properly
I have been using graphene in django with graphql and a React frontend.
I can get a create mutation to work, but an edit one won't - even tho the query without $ variables works in graphiQL
My gql const in React is:
export const EDIT_PERSON = gql`
…

Davtho1983
- 3,827
- 8
- 54
- 105
0
votes
1 answer
GraphQL mutation to create foreign key address and person
I have looked at a lot of articles about mutations with foreign keys and nothing is helping.
I need to create a person with a django model Person, that has an address that is a foreign key to the Address model. A person needs an address!
My models…

Davtho1983
- 3,827
- 8
- 54
- 105
0
votes
1 answer
AssertionError: You need to pass a valid Django Model in UserProfile.Meta, received "None"
I'm adding Django Model to a graphql api using the AbstractBaseUser custom user model. The Admin works fine except that I get an error when trying to access the graphql api, 'You need to pass a valid Django Model in UserProfile.Meta, received…

Isisco
- 141
- 9
0
votes
0 answers
GraphQL execution errors for query
I'm setting up my graphql client using Appolo-vue. I passed my authorization token in my http headers but i get 200 ok status code but did not get back any data.
I'm setting up my graphql client using Appolo-vue. I passed my authorization token in…

Udemezue John
- 128
- 2
- 12
0
votes
1 answer
How to change name of DjangoObjectType field on response data
Right now I have a django model.
class MyModel(models.Model, GetMixin):
logo_url = models.URLField()
And attached it up to DjangoObjectType.
class MyModelType(DjangoObjectType):
class Meta:
model = MyModel
Now I need to change…

Shift 'n Tab
- 8,808
- 12
- 73
- 117
0
votes
2 answers
Cannot return null for non-nullable fiel error with graphene form mutations
I'm trying an example of graphene-django with forms. But I get next error:
`graphql.error.base.GraphQLError: Cannot return null for non-nullable field [MyMutationPayload.name].
I'd tried set values in return expression inside perform_mutate…

cristhiam
- 496
- 1
- 4
- 17