Skip to main content

Restaurant

A Restaurant represents a single physical location where diners can order food.

Schema

type Restaurant {
  id: ID!
  name: String!

  # Address
  street: String!
  city: String!
  state: String!
  stateCode: String!
  zipCode: String!
  country: String!
  countryCode: String

  # Coordinates
  latitude: Float!
  longitude: Float!

  # Contact
  phoneNumber: String
  websiteUrl: URL
  logoUrl: URL
  description: String

  # Status
  isOpen: Boolean
  isPermanentlyClosed: Boolean

  # Hours
  operatingHours: [OperatingHours!]!

  # Related
  menus: [Menu!]!
  cuisines: [Cuisine!]!
  chain: Chain

  # Metadata
  createdAt: DateTime!
  updatedAt: DateTime!
}

Key Fields

Location

FieldTypeDescription
streetStringStreet address
cityStringCity name
stateStringFull state name
stateCodeStringState abbreviation (e.g., “PA”)
zipCodeStringPostal code
countryStringCountry name
latitudeFloatGPS latitude
longitudeFloatGPS longitude

Contact

FieldTypeDescription
phoneNumberStringContact phone
websiteUrlURLRestaurant website
logoUrlURLLocation-specific logo

Status

FieldTypeDescription
isOpenBooleanCurrently open right now?
isPermanentlyClosedBooleanHas this location closed?

Example Query

query GetRestaurant($id: ID!) {
  restaurant(menuKey: "your_key", id: $id) {
    id
    name
    street
    city
    state
    zipCode
    latitude
    longitude
    phoneNumber
    isOpen
    operatingHours {
      day
      openTime
      closeTime
    }
    menus {
      id
      name
    }
  }
}

Example Response

{
  "data": {
    "restaurant": {
      "id": "rest_123",
      "name": "Honeygrow - Market Street",
      "street": "1601 Market Street",
      "city": "Philadelphia",
      "state": "Pennsylvania",
      "zipCode": "19103",
      "latitude": 39.9526,
      "longitude": -75.1652,
      "phoneNumber": "(215) 555-0123",
      "isOpen": true,
      "operatingHours": [
        { "day": "Monday", "openTime": "10:30", "closeTime": "21:00" },
        { "day": "Tuesday", "openTime": "10:30", "closeTime": "21:00" },
        { "day": "Wednesday", "openTime": "10:30", "closeTime": "21:00" }
      ],
      "menus": [
        { "id": "menu_main", "name": "Main Menu" }
      ]
    }
  }
}

Operating Hours

type OperatingHours {
  day: DayOfWeek!     # Monday, Tuesday, etc.
  openTime: String!   # "10:30" (24-hour format)
  closeTime: String!  # "21:00" (24-hour format)
}
If closeTime is earlier than openTime, the restaurant is open past midnight (e.g., “22:00” to “02:00”).

Listing Restaurants

All Restaurants in a Chain

query GetRestaurants {
  restaurants(menuKey: "chain_key") {
    edges {
      node {
        id
        name
        city
        state
        isOpen
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
    totalCount
  }
}

Find Nearby Restaurants

query GetNearbyRestaurants(
  $lat: Float!,
  $lng: Float!,
  $radiusMiles: Float
) {
  restaurants(
    menuKey: "chain_key",
    near: { latitude: $lat, longitude: $lng, radiusMiles: $radiusMiles }
  ) {
    edges {
      node {
        id
        name
        city
        distance  # Miles from search point
        isOpen
      }
    }
  }
}

Restaurant-Specific Dishes

When querying dishes, you can filter by restaurant to get location-specific menus:
query {
  dishes(
    menuKey: "chain_key",
    filters: {
      restaurantId: "rest_123"  # Only dishes at this location
    }
  ) {
    results {
      dish { name }
    }
  }
}
This is useful for chains with regional menu variations.

Display Patterns

Location Selector

Location Selector
Show restaurants with:
  • Name
  • Address
  • Distance from user
  • Open/closed status
  • Operating hours

Map Integration

Use latitude and longitude to plot locations on a map:
restaurants.map(r => (
  <Marker
    key={r.id}
    position={[r.latitude, r.longitude]}
    title={r.name}
  />
))