1

I have a todo list application that I'm experimenting with that has subtasks. Each parent task has a children array containing the ids of the child tasks. Once the parent task is expanded, the query to the server kicks off to populate those child tasks. Make sense so far?

What I'm trying to approach is to get the parent task from the child task component. So, traditionally I would have a query called getParentTask($taskId) that would hit a resolver on the server, but I already have the tasks in the cache. I think I want to do a resolver-type query on the cached data? How or where do I do that?

I get that there are hundred other ways to do this with props or other (possibly better solutions), but I found myself stuck trying to understand how to do this in Apollo, so now I want to learn!

Scott
  • 3,204
  • 3
  • 31
  • 41

0 Answers0