references/queries.md · 24000
er }) => { if (!Number.isInteger(data.channelId)) { throw new Error("channelId must be an integer") }
return data
}) .handler(({ data, context }) => realtime.seal({ query: messagesQuery(context.user.id, data.channelId) }) )
The browser calls `sealMessages` to get the sealed query, and calls it again to [renew it](#renewing-sealed-queries).
To seal the query while the page renders on the server, see the [Server-side rendering](ssr.md) guide and the [Next.js](https://neon.com/docs/realtime/examples/nextjs.md) and [TanStack](https://neon.com/docs/realtime/examples/tanstack.md) examples.