# Boxes on a canvas page: the landing page (page "index") or an # admin-created Page (page = its slug; the home page /stp is the Page "stp"). # Anyone may read a page's layout — it is the page — but only an admin may # change it, and adminOnly boxes are only ever returned to an admin. x/y/w/h # are px on a fixed 1400px-wide design canvas; see models.Box. # # kind is "widget" (a built-in Vue component named by `widget`) or "html" # (`html` rendered in a sandboxed iframe on the front end). An html box with a # componentId is linked to that Component: its html is the component's, and # updateBox refuses to change it (component.graphql). type Box { id: ID! createdAt: Time! updatedAt: Time! page: String! kind: String! widget: String html: String title: String x: Int! y: Int! w: Int! h: Int! z: Int! framed: Boolean! # A CSS box-shadow value, or "" for none. shadow: String! hideOnMobile: Boolean! adminOnly: Boolean! componentId: ID } input CreateBoxInput { page: String! kind: String! widget: String html: String title: String x: Int y: Int w: Int h: Int z: Int framed: Boolean shadow: String hideOnMobile: Boolean adminOnly: Boolean # Links the new box to this component; kind is then "html" and html is # ignored. componentId: ID } input UpdateBoxInput { widget: String html: String title: String x: Int y: Int w: Int h: Int z: Int framed: Boolean shadow: String hideOnMobile: Boolean adminOnly: Boolean } extend type Query { boxes(page: String!): [Box!]! } extend type Mutation { createBox(input: CreateBoxInput!): Box! @admin updateBox(id: ID!, input: UpdateBoxInput!): Box! @admin deleteBox(id: ID!): Box! @admin }