Skip to content

How to look-ahead when resolving an entity? #1248

@edmondop

Description

@edmondop

I had this setup:

type MyStuff {
   .. other stuff ommitted
  entries: [Entry!]!
}
type Query {
  myStuffs(
    stuffFilter: StuffFilter
    entriesFilter: EntriesFilter
  ): [MyStuff!]!

my resolver invokes a single service, passing down the entries filter.

I am considering a more graphql-idiomatic approach like so:

type MyStuff {
   .. other stuff ommitted
  entries(filter: EntriesFilter): [Entry!]!
}
type Query {
  myStuffs(
    stuffFilter: StuffFilter
  ): [MyStuff!]!

however in my resolver now it's unclear how to extract the filter from the query to pass it down to the service level. How do I do that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions