graphql/dataloader

nested queries and info

Aperta

#272 aperta il 30 mag 2021

 (1 commento) (2 reazioni) (0 assegnatari)JavaScript (556 fork)batch import
help wanted

Metriche repository

Star
 (12.520 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

I have a query that looks like this:

movies {
  name
  actors {
    firstname
    lastname
    movies {
      name
    }
  }
}

at the moment it is very easy for me to use the dataloader to query the actors of each movie but I have two problems:

  1. how do I use the dataloader to query the children of the children? In my case the movies of an actor
  2. how can I pass the parsed info data (so I know what fields are queried) to the dataloader, without reparsing the info, because as you know, the children-resolver is invoked for each parent

would be nice to see a simple example thanks in advanced!

Guida contributor