Ostorya dev docs

Getting started

IDs and user errors

Global IDs and how mutations report problems.

Global IDs#

Every object has a global ID: gid://ostorya/<Type>/<uuid>, for examplegid://ostorya/Order/7c1e…. Treat IDs as opaque strings; node(id:) fetches any object by ID.

userErrors#

Mutations don't throw for invalid input. They return the resource (or null) and a userErrors list with thefield path, a readable message and a stable code. Always select userErrors and show the messages.

mutation {
  productUpdate(product: { id: "gid://ostorya/Product/00000000-0000-0000-0000-000000000000", title: "Caftan" }) {
    product { id title }
    userErrors { field message code }
  }
}

Top-level errors are for problems with the request itself: authentication, scopes, cost, syntax.