graphql-python / graphql-python/gql

DSL: Compose query with all nested fields included

Ouverte
#316 5 commentaires 3 réactions 0 personnes assignées Voir sur GitHub
type: feature
Langage dominant
Python
Étoiles
1.7k
Forks
195
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Hello!

I'm building my query dynamically. I want to select all the nested sub fields _(children, grand children etc)_. Is there a way to accomplish this with `gql`?

I'm not very fluent in graphql but I do know it's possible to build infinite nested queries, so is it even possible/easy to prevent that from happening?

I've experimented with looping through `ds.Content._type.fields` to somehow select each field and any children they might parent. But I find it confusing as some objects contains `of_type` attribute while others do not and I don't know why that is.

Might I be better off doing an introspection with

```graphql
{
__schema {
types {
name
fields {
name
}
}
}
}
```

and determine any children by simply parsing the json data? Seems redundant.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.