graphql/dataloader

nested queries and info

Open

#272 aberto em 30 de mai. de 2021

Ver no GitHub
 (1 comment) (2 reactions) (0 assignees)JavaScript (556 forks)batch import
help wanted

Métricas do repositório

Stars
 (12.520 stars)
Métricas de merge de PR
 (Mesclagem média 5d 2h) (1 fundiu PR em 30d)

Description

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!

Guia do colaborador