graphql-python / graphql-python/graphene-mongo

Can't query EmbeddedDocumentListField with parameters

Aperta
#182 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
287
Fork
111
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

EmbeddedDocumentListField can't be queried with parameters.

Running the example at https://github.com/graphql-python/graphene-mongo/tree/master/examples/flask_mongoengine
and replacing the query with
```
{
allEmployees {
edges {
node {
id,
name,
department {
id,
name
},
roles {
edges {
node {
id,
name
}
}
},
leader {
id,
name
}
tasks(last:1) { # note the parameter here
edges {
node {
name,
deadline
}
}
}
}
}
}
}
```
we get the errors
```
"errors": [
{
"message": "'Task' object has no attribute 'pk'",
"locations": [
{
"line": 23,
"column": 9
}
],
"path": [
"allEmployees",
"edges",
1,
"node",
"tasks"
]
},
{
"message": "'Task' object has no attribute 'pk'",
"locations": [
{
"line": 23,
"column": 9
}
],
"path": [
"allEmployees",
"edges",
2,
"node",
"tasks"
]
}
]
```
How to solve this ?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia riproducendo la query in examples/flask_mongoengine, in particolare tasks(last:1) su EmbeddedDocumentListField. Segui il percorso che produce gli errori "Task" object has no attribute "pk" e considera completata l'issue quando le tasks parametrizzate restituiscono edges validi senza quegli errori.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
graphql, mongodb, python
Ambito
api, backend, databases
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.