MenuSection¶
A MenuSection is a section of a Menu, such as Starters: partOfMenu names its menu (or
partOfMenuSection the section it is in), position its place, and hasMenuItem and hasMenuSection list its dishes
and subsections, computed.
Modeled on schema.org/MenuSection · JSON Schema · ABAC object type MenuSection
Example¶
Create one with POST /menusections:
{
"name": [
{
"at_language": "en",
"at_value": "Starters"
}
],
"position": 1,
"partOfMenu": {
"at_id": "https://apis.objectsgrid.com/menus/5d6e7f80-91a2-4b3c-8d4e-5f6a7b8c9d0e"
}
}
Fields¶
Required: name.
| Field | Type | Required | Description |
|---|---|---|---|
at_context |
https://schema.org |
JSON-LD @context, always https://schema.org. |
|
at_type |
MenuSection |
JSON-LD @type, the object's type name. |
|
at_id |
URL | The object's ObjectsGrid URL, https://apis.objectsgrid.com/<path>/<id>, its JSON-LD @id: what References to it hold. Assigned by ObjectsGrid. |
|
id |
string | The object's id. Assigned by ObjectsGrid when the object is created. | |
identifier |
string | The object's id, as Schema.org identifier. Assigned by ObjectsGrid. |
|
url |
URL | The object's own URL, https://apis.objectsgrid.com/<path>/<id>. Assigned by ObjectsGrid. |
|
name |
list of LanguageTaggedString | Yes | The MenuSection name. See schema.org/name. |
description |
list of LanguageTaggedString | The MenuSection description. See schema.org/description. | |
image |
URL | An image URL | |
position |
integer | Its place on the menu, 1 first | |
partOfMenu |
Reference to Menu | The Menu it belongs to. ObjectsGrid's, beyond Schema.org: Schema.org links a menu to its sections, not back; the menu's hasMenuSection is computed from this; left out of JSON-LD documents. | |
partOfMenuSection |
Reference to MenuSection | The section it is a subsection of. ObjectsGrid's, beyond Schema.org: Schema.org links a section to its subsections, not back; left out of JSON-LD documents. | |
hasMenuSection |
computed: list of MenuSection | Its subsections. Computed, read-only: the objects whose MenuSection.partOfMenuSection points to this object, listed from that type; never stored or written. | |
hasMenuItem |
computed: list of MenuItem | Its dishes. Computed, read-only: the objects whose MenuItem.partOfMenuSection points to this object, listed from that type; never stored or written. | |
tags |
list of Tag | Tags your ABAC policy decides on. Created empty when not sent, kept by a PUT that leaves them out, cleared by null or []. |
|
meta |
ObjectMeta | Read-only metadata: version, type, creation and last update. |
REST API¶
Base URL https://apis.objectsgrid.com. Every request sends the X-ObjectsGrid-AccessPoint and Authorization: Bearer <access token> headers; see the REST API guide.
| Operation | Request |
|---|---|
| Create | POST /menusections |
| List and search | GET /menusections |
| Create up to 100 at once | POST /menusections/batch |
| Retrieve | GET /menusections/{id} |
| Retrieve as a JSON-LD document for your pages | GET /menusections/{id} with Accept: application/ld+json; see JSON-LD for your pages |
| Replace | PUT /menusections/{id} |
| Update some fields | PATCH /menusections/{id} |
| Delete | DELETE /menusections/{id} |
The OpenAPI contract, with every parameter and response: MenuSections (JSON).
GraphQL¶
Endpoint POST https://apis.objectsgrid.com/graphql; see the GraphQL guide.
| Operation | Field |
|---|---|
| Query | menuSection(id: ID!, version: String): MenuSection |
| Query | menuSections(where: MenuSectionWhereInput, orderBy: [MenuSectionOrderByInput!], first: Int, after: String): MenuSectionConnection! |
| Query | menuSectionsGroupBy(by: [MenuSectionGroupByField!]!, where: MenuSectionWhereInput, having: MenuSectionHavingInput, orderBy: [MenuSectionGroupByOrderByInput!], first: Int, after: String): MenuSectionGroupByConnection! |
| Mutation | createMenuSection(input: CreateMenuSectionInput!): MenuSection! |
| Mutation | updateMenuSection(input: UpdateMenuSectionInput!, expectedVersion: String): MenuSection! |
| Mutation | deleteMenuSection(id: ID!, expectedVersion: String): Boolean! |
Webhook events¶
Subscribe to these events in your webhook configuration to be called when a MenuSection changes:
MenuSectionCreated, MenuSectionUpdated, MenuSectionPatched, MenuSectionDeleted.