Skip to content

DSL: Compose query with all nested fields included #316

Open
@iwconfig

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

{
  __schema {
    types {
      name
      fields {
        name
      }
    }
  }
}

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

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions