async-graphql icon indicating copy to clipboard operation
async-graphql copied to clipboard

Deep nested fields with `@requires` and no identifiers.

Open urmaul opened this issue 8 months ago • 0 comments

How can I use @requires on nested subfields that have no identifiers?

My schema looks like this:

extend type Thing @key(fields: "id") {
  id: ID! @external
  subThings: [SubThing!] @external
  nextFilteredFoo: String @requires(fields: "subThings { subSubThings { foo } }")
}

extend type SubThing {
	subSubThings: [SubSubThing!]! @external
}

extend type SubSubThing {
	foo: String! @external
}

I can't make a function like find_subsubthing_by_id because there is no ID and it looks like subThings is not filled if I don't have something like this.

Is it a way to get the required data in thins case?

urmaul avatar May 28 '24 13:05 urmaul