Skip to main content
Version: 0.24

Type Alias: Reference<AppValue>

Reference<AppValue> = RefObject | AppValue

Represents a value from your app passed into the Wasp spec.

Use reference imports when passing values from your app into the Wasp spec. If a direct import is not practical, use ref as a fallback.

Type Parametersโ€‹

AppValueโ€‹

AppValue

The expected TypeScript type for the value from your app. The field using Reference<AppValue> decides this type. For example, Page.component expects a React component, Query.fn expects a server function, and env schema fields expect a ZodSchema.

Exampleโ€‹

import { app, query } from "@wasp.sh/spec"
import { getTasks } from "./src/queries" with { type: "ref" }

export default app({
// ...
spec: [
query(getTasks, { entities: ["Task"] }),
],
})