Re:Introducing Yelp's GraphQL API
by infogulch on Wednesday May 03, 2017 @08:10PM
(#14261397)
You can recurse in GraphQL so if they added a `favorited_businesses` field to `user` then it would be possible. Something like this:
[ Parent
| on HN ]
Re:Introducing Yelp's GraphQL API
by sleepingeights on Thursday May 04, 2017 @03:20AM
(#14263130)
GraphQL looks cool, kind of fancy but simpler way to do some complex SQL without the SQL.
Using the business as the root query would be a bit cumbersome, but more like:
business(id: "garaje-san-francisco") {
reviewers {
user {
name
favorited_businesses
favorited_businesses(name: "garaje")
}
}
}
If they provide user queries, then something like: user {
name
favorited_businesses
favorited_businesses(name: "garaje")
}