How to efficiently use the result of a Hasura query for another query?

Viewed 1089

I am currently querying my Hasura database using userId to get location.

users(where: {id: {_eq: 1528}}) {
    location
}

I then use location to query users near that one user.

    users(
      where:
        { location: {_st_d_within: {distance: 20000, from: $point }}},
    ) {
      firstName
      city
      region
    }
  }

Is there a way to efficiently combine these two queries such that I only query once?

1 Answers
Related