For questions about Ariadne - the Python library for implementing GraphQL servers. When using this tag also include the more generic [python] tag.
Questions tagged [ariadne-graphql]
41 questions
5
votes
1 answer
Add Headers in Ariadne GraphQL Response
I am using ariadne to make a graphql server using python.
I want to add headers to the response like Set-Cookie for setting a cookie.
Is there a way to do so? If not is there a way to set a cooke in ariadne.
I am using React as frontend.
Please…

SuPythony
- 875
- 8
- 23
4
votes
1 answer
Can't enable CORS / allow headers in python graphql framework - ariadne
When i connec't from my React frontend app to my graphql backend created in python Ariadne i get this error.
React query
const uri = 'http://localhost:8000/'
const link = new HttpLink({
uri,
const client = new ApolloClient({
link,
…

Tomasz
- 1,895
- 1
- 14
- 17
3
votes
0 answers
How to handle Authentication & Authorization with Flask and Ariadne (GraphQL)?
This is the first API I ever make so bare with me.
I was working on a RESTful API made in Flask to interact with my React frontend when I discovered GraphQL. Being an amazing way to save on network recourses I decided to switch to it. I chose…

Maypher
- 90
- 1
- 11
3
votes
0 answers
GraphQL Ariadne python Getting 'Cannot return null for non-nullable field' though value is not null
I am getting and error about returning null for the success field but it is included in my return payload.
return payload looks like this
{'success': True, 'GeneratedKeywords': [{'id': 1, 'file_id': 1, 'keywords': 'keyword', 'generated_date':…

Hammocktester
- 31
- 1
3
votes
0 answers
nested resolvers in Ariadne
When querying for list of products I need to show the product information along with variation. I mean i want products query to return something like this
{
"data": {
"product": {
"id": "1",
"name": "Polo Shirt",
…

Serenity
- 3,884
- 6
- 44
- 87
3
votes
2 answers
How to use background tasks with Starlette when there's no background object?
I'm hoping to avoid any use of Celery at the moment. In Starlette's docs they give two ways to add background tasks:
Via Graphene: https://www.starlette.io/graphql/
class Query(graphene.ObjectType):
user_agent = graphene.String()
def…

Austin Peña
- 300
- 4
- 11
3
votes
0 answers
Proper way to authenticate graphql with facebook
I'm doing web application using graphql (ariadne) + Django. Now I want to integrate it with Facebook authentication without using DRF. So I wanted to use jwt. Is there any good practice or suggestions ? What is the proper way of doing authentication…

Zorig
- 585
- 1
- 10
- 26
2
votes
1 answer
Ariadne Python : ModuleNotFoundError: No module named 'graphql.type'
I am getting following error when using latest ariadne 0.16.1 with graphql-core 3.2.3 and Python 3.10. It's a FastAPI app.
from fastapi import FastAPI
from ariadne.asgi import GraphQL
Second line throws the error
from graphql.type import…

N.Moudgil
- 709
- 5
- 11
2
votes
1 answer
Upload file with GraphQL +Ariadne + Flask: graphql.error.graphql_error.GraphQLError: Operation data should be a JSON object
I'm trying to upload a file using this technology stack (Flask + Graphql + Ariadne). I've implemented other APIs but now for file upload it is returning this error.
ERROR
Traceback (most recent call last):
File…

Sagar Wankhede
- 302
- 3
- 7
2
votes
0 answers
Apollo Federation (Gateway): how to send different "keys" to different implementing microservices?
I am trying to compose a federated apollo service with a gateway and 3 implementing microservices.
MS1:
type Movie @key(fields: "id name") {
id: String!
name: String
}
MS2:
type Location @key(fields: "id") {
id: String!
longitude:…

ashiaka
- 3,994
- 8
- 32
- 45
2
votes
0 answers
Middleware in GraphQLView doesn't work in Django Ariadne Graphql
i am new to ariadne, i defined my typedef and resolvers and every thing is up and runing, but i want to use django-ariadne-jwt for JWT things in my project, in django-ariadne-jwt documnets there is a line of code which doesn't work, the line is…

Ahmad Mansoori
- 177
- 1
- 11
2
votes
2 answers
Python Ariadne GraphQL "cannot import name 'GraphQLNamedType'"
I am using Ariadne with Flask.
When I try from ariadne import QueryType, graphql_sync, make_executable_schema as indicated in the Ariadne's doc for Flask I get the following error :
ImportError: cannot import name 'GraphQLNamedType'
I am using :…

F Blanchet
- 1,430
- 3
- 21
- 32
2
votes
1 answer
folder design when using ariadne in django
I am trying to explore ariadne in my django project. However, I am feeling extremely tough to create a folder structure as I don't see much example mainly focused on that. Also I did not find any single tutorial. Everywhere the same way is done that…

Serenity
- 3,884
- 6
- 44
- 87
1
vote
0 answers
DRY: how to get a basic React/Apollo web app and python GraphQL backend API going with minimal duplication?
I'm an experienced SWE but sort of new to modern web development. I'd like to build a demo/prototype website for a startup idea with minimal time. I'd like to have the frontend tied to a backend DB store up front so it's fully functional. I'd like…

eraoul
- 1,072
- 12
- 19
1
vote
1 answer
No module named 'graphql.type' in Django
I am New in Django and GraphQL, following the the article,
I am using python 3.8 in virtual env and 3.10 in windows, but same error occurs on both side, also tried the this Question, i also heard that GraphQL generate queries, But dont know how to…

Talha Zafar
- 17
- 6