Zuppler Elixir Client v0.0.13 Zuppler.Restaurant
Zupper Restaurant Wrapper
Summary
Functions
Load Zuppler Retaurant by graphql query
Load Zuppler Retaurant by named graphql query with variables
Types
t()
t() :: %Zuppler.Restaurant{amenities: String.t, cuisines: String.t, locale: String.t, locations: [Zuppler.Location.t], name: String.t, permalink: String.t, services: [Zuppler.Service.t]}
Functions
Load Zuppler Retaurant by graphql query
Example
Zuppler.Restaurant.find("""
{
restaurant(id: 242) {
name
id
cuisines
amenities
locations {
id
address {
city
country
state
geo {
lat
lng
}
}
}
}
}
"""
)
should return something like this:
{:ok, %Zuppler.Restaurant{amenities: "Online Orders, Cocktail, Air Condition (A/C), Late Night",
cuisines: "Continental, Pizza, Seafood",
locations: [
%Zuppler.Location{
id: 1,
%Zuppler.Address{city: "Norristown", country: nil,
geo: %Zuppler.Address.Geo{lat: 40.14543, lng: -75.393859}, id: "685",
state: "PA"}
},
%Zuppler.Location{
id: 2,
%Zuppler.Address{city: "Conshohocken", country: "US",
geo: %Zuppler.Address.Geo{lat: 40.074143, lng: -75.292784}, id: "757230",
state: "PA"}
}
],
name: "demo", permalink: "demorestaurant"}
}
or
{:error, message}
Load Zuppler Retaurant by named graphql query with variables
Example
query = """
query RestaurantById($id: ID) {
restaurant(id: $id) {
name
id
cuisines
amenities
locations {
id
address {
city
country
state
geo {
lat
lng
}
}
}
}
}
"""
variables = %{id: 242}
Zuppler.Restaurant.find(query, variables)
should return something like this:
{:ok, %Zuppler.Restaurant{amenities: "Online Orders, Cocktail, Air Condition (A/C), Late Night",
cuisines: "Continental, Pizza, Seafood",
locations: [
%Zuppler.Location{
id: 1,
%Zuppler.Address{city: "Norristown", country: nil,
geo: %Zuppler.Address.Geo{lat: 40.14543, lng: -75.393859}, id: "685",
state: "PA"}
},
%Zuppler.Location{
id: 2,
%Zuppler.Address{city: "Conshohocken", country: "US",
geo: %Zuppler.Address.Geo{lat: 40.074143, lng: -75.292784}, id: "757230",
state: "PA"}
}
],
name: "demo", permalink: "demorestaurant"}
}
or
{:error, message}