← Workspace Academy

Workspace Academy · 1 / 5

Find a customer

Build a useful directory, keeping the result alias and list binding aligned.

YOUR TASK

Make this happen

2 steps
  1. Build a read-only customer table from customers.edges, using a Customer column bound to customer.node.name. Define workspace_table_column.name, workspace_record_table.customers and workspace_panel.directory (title Customers); include the query before the table in panel children.

  2. Check the complete solution, then inspect any unmet requirements.

Read the starter files

main.cococo

workspace_document "handoff" {
  id = "customer-desk"
  title = "Customer desk"
  role = "Customer service"
  domains = "customer"
  children = [workspace_panel.directory]
}

directory.cococo

workspace_query_graphql "customers" {
  component = "query-graphql"
  source = "query CustomerDirectory { customers: listCustomers(first: 50) { edges { node { id name } } } }"
}
workspace_table_column "name" {
  component = "table-column"
  label = "Customer"
  # TODO: bind value to customer.node.name.
}
workspace_record_table "customers" {
  component = "record-table"
  id = "customer-table"
  # TODO: bind customers.edges as customer and attach the name column.
}
workspace_panel "directory" {
  component = "panel"
  id = "directory"
  title = "Customers"
  # TODO: attach the query, followed by the table.
}
Supplied supporting files

Reference: workspaces · getting-startedworkspaces · binding-stateworkspaces · queriesworkspaces · formsworkspaces · server-luaworkspaces · publication