I would like to execute 2 queries with hooks where the second query uses information retrieved in the first one. For example:
const { data, error, loading } = useQuery(GET_DOGS);
const result2 = useQuery(GET_BREEDS, { variables: { dogId: data[0].id } });
Right now I do it using some state and setting the skip
parameter on the second hook, however I figure there must be some easier solution which I might be overlooking?