Yelp / yelp-fusion

Yelp Fusion API
https://yelp.com/developers
MIT License
401 stars 393 forks source link

More than one search term for query in GraphQL console? #471

Closed Thom84 closed 5 years ago

Thom84 commented 6 years ago

Hello,

I tried several times to add an additional search term to a query without any success. Would you be able to provide an example of running a GraphQL query with more than one search term? I know this issue was addressed for using the Yelp Api directly but I am not sure how to access the Yelp API other than using the GraphQL console. And I could not access the links that provide the query examples. Any and all help would be appreciated!

watterso commented 5 years ago

Hey @Thom84, In the GraphQL world you can have multiple Queries in one request by using Aliases. Heres an example query on our api:

{
  burrito_search: search(term: "burrito", location: "san francisco") {
    total
    business {
      name
    }
  }
  plumber_search: search(term: "plumber", location: "san francisco") {
    total
    business {
      name
    }
  }
}

If you want to play around with this query heres a link to it on our console - 🔗link🔗

Good Luck!