Skip to content

Preview & Hints

Preview is the feedback loop that keeps your model honest. It should be part of every modelling iteration, not reserved as a final validation step. When you open a preview, Mockomat generates a GraphQL schema from the current model state, executes a sample query against your mapped data, and returns results alongside readiness hints that identify gaps requiring attention.

This page covers how previewing works, the types of hints the system produces, and the iteration workflow that connects model changes to actionable feedback.

Screenshot ws-preview-01-overviewScreenshot ws-preview-01-overview
ws-preview-01-overviewMissing

Preview panel showing data results and readiness hints side by side.

How Preview Works

Every preview execution follows a deterministic pipeline:

  1. Schema generation — Mockomat reads your current model (tables, attributes, relations, views) and produces a GraphQL schema. This schema reflects the exact state of the model at the moment of invocation.
  2. Sample query execution — a query is executed against the generated schema, resolving fields through the configured data mappings (OFF_FIELD, FAKE, or CONST) and relation definitions.
  3. Hint calculation — the system analyses the model for completeness, consistency, and configuration correctness. Every gap or mismatch produces a typed hint.
  4. Result presentation — the data response and the hint list are displayed together, giving you both the output and the diagnosis in a single view.

The preview always reflects the current model state. If you change an attribute, add a relation, or modify a mapping, the next preview invocation incorporates that change immediately.

Screenshot ws-preview-02-pipelineScreenshot ws-preview-02-pipeline
ws-preview-02-pipelineMissing

Preview pipeline: schema generation, query execution, hint calculation, result presentation.

Opening the Preview

There are two entry points for launching a preview:

From the Modelling Board

Every table card on the Modelling Board has a play button in its header area. Clicking it opens the preview for that table.

  • If a view already exists for the table, the preview opens in edit mode with all existing configuration loaded.
  • If no view exists, the preview opens with default settings and a Create button to save the configuration as a new view record.

From the Records Page

On the records page, each table row has a play button in its action column. This behaves identically to the board entry point.

Both paths open the Modelling Runtime Preview panel, which combines view configuration, live data preview, and relation detail in a single interface.

Screenshot ws-preview-03-entry-pointsScreenshot ws-preview-03-entry-points
ws-preview-03-entry-pointsMissing

Play button locations on the modelling board table card and records page row.

Hint Types

Hints are actionable signals derived from model completeness analysis. Each hint identifies a specific gap or inconsistency and points toward the corrective action. Hints are recalculated on every preview invocation.

HintMeaningAction
Unmapped attributeA field has no data source configured. The field exists in the schema but cannot resolve to any value.Assign an OFF_FIELD, FAKE, or CONST mapping in the attribute configuration. See Data Sources.
Missing endpoint metadataA query or operation lacks required configuration such as a query name or pagination defaults.Open the API Design view and complete the endpoint setup for the affected table.
Configuration mismatchA field is marked with a flag (sortable, filterable, searchable) that is incompatible with its data type or mapping.Review the attribute type and flag combination in the Tables & Attributes editor.
Relation warningA relation references a target entity or linking column that does not exist or is misconfigured.Check the relation definition in the table editor. See Relations for guidance on cardinality and direction.

Hint Severity

Not all hints carry equal weight. The system distinguishes between:

  • Errors — the model cannot produce valid runtime output until this issue is resolved. Example: an unmapped attribute that is required.
  • Warnings — the model functions but with degraded behaviour. Example: a sortable flag on a field whose mapping does not support ordering.
  • Informational — suggestions for improvement that do not affect runtime correctness. Example: a table with no relations defined.
Screenshot ws-preview-04-hint-typesScreenshot ws-preview-04-hint-types
ws-preview-04-hint-typesMissing

Hint list showing error, warning, and informational severity levels.

The Iteration Workflow

The most productive modelling workflow follows a tight loop between model changes and preview feedback. The goal is to keep the cycle short — seconds, not minutes.

  1. Make a model change — add a table, modify an attribute, create a relation, or adjust a mapping.
  2. Open preview — run a query and inspect the results.
  3. Review hints — address any errors or warnings surfaced by the hint system.
  4. Update API design — adjust query names, operation exposure, or pagination defaults if needed. See API Design.
  5. Repeat — continue until the model is stable and the preview returns a clean hint list.

Each pass through this loop refines the model incrementally. Short cycles surface problems early, before they compound into structural issues that are harder to resolve.

Screenshot ws-preview-05-iteration-loopScreenshot ws-preview-05-iteration-loop
ws-preview-05-iteration-loopMissing

Diagram of the iteration workflow: model change, preview, hints, API update, repeat.

Why Short Cycles Matter

Delayed validation is the primary source of modelling rework. When you build ten tables before previewing, any structural issue in the first table may have propagated through relations and views. Previewing after each meaningful change keeps the blast radius small and the corrective effort minimal.

What to Validate in Preview

When inspecting preview results, focus on these aspects:

Validation AreaWhat to CheckRelated Page
Field readabilityAre field names consistent? Use camelCase, avoid abbreviations.Tables & Attributes
Data shape consistencyDo fields return the expected types (string, number, boolean, date)?Tables & Attributes
Relation behaviourDoes a 1:n relation return an array? Does a 1:1 relation return an object?Relations
Mapping completenessDo all attributes have a configured data source? Are there unmapped-attribute hints?Data Sources
Filter and sort behaviourDo fields marked as filterable and sortable respond to operations in the query?Tables & Attributes
Null handlingDo optional fields correctly return null when no data is available?Tables & Attributes
Screenshot ws-preview-06-validation-checklistScreenshot ws-preview-06-validation-checklist
ws-preview-06-validation-checklistMissing

Preview result inspection showing field types, relation nesting, and null handling.

Common Preview Issues

The following table summarises frequently encountered issues during preview and their resolutions.

IssueLikely CauseFix
Field returns null unexpectedlyNo data mapping configured for the attributeAssign an OFF_FIELD, FAKE, or CONST mapping in the attribute editor
Relation returns an empty arrayRelation not properly defined — wrong direction, missing foreign key, or target entity does not existReview the relation definition. See Relations
Sort has no effect on query resultsThe field is not marked as sortableEnable the sortable flag in the attribute configuration
Filter returns all recordsThe field is not marked as filterableEnable the filterable flag in the attribute configuration
Query name not foundEndpoint metadata is incompleteOpen API Design and configure the query name for the table
Nested query returns incorrect dataLinking columns in the relation are misconfiguredVerify that the source and target columns in the relation editor match the actual data structure

Causality: Model State, Hints, and Required Actions

Understanding the causal relationship between model state and hints is essential for efficient modelling.

How Hints Are Derived

Every model change triggers hint recalculation during the next preview. The system evaluates:

  • Attribute completeness — does every attribute have a type, a name, and a data mapping?
  • Relation integrity — does every relation reference a valid target entity and valid linking columns on both sides?
  • Endpoint readiness — does every exposed query have a name, pagination defaults, and at least one resolvable field?
  • Flag consistency — are attribute flags (sortable, filterable, searchable) compatible with the attribute type and mapping?

What a Clean Hint List Means

When the preview returns no errors or warnings, the model satisfies all structural and configuration requirements. This means:

  • Every attribute resolves to a data value.
  • Every relation produces correctly nested output.
  • Every exposed query is fully configured and executable.
  • The mock API endpoint is ready for consumer use.

What Unresolved Hints Mean

Unresolved hints indicate gaps that will affect runtime behaviour. An unmapped attribute returns null. A misconfigured relation returns empty results. A missing query name prevents consumers from discovering the endpoint. Hints are not cosmetic — they correspond directly to runtime defects.

Screenshot ws-preview-07-causalityScreenshot ws-preview-07-causality
ws-preview-07-causalityMissing

Causality diagram: model state determines hints, hints guide required actions, resolved hints indicate readiness.

  • Modelling Runtime Preview — the combined preview panel with view configuration, live data, and relation detail
  • Tables & Attributes — attribute configuration, data mappings, and field flags
  • Relations — relation types, linking columns, and cardinality
  • Data Sources — available datasets and data object selection
  • API Design — query naming, operation exposure, and pagination defaults
  • Modelling Board — the visual canvas where domain entities are created and arranged