Retrieving data for menu singleton in SvleteKit app

I have a SvelteKit app, with route-name.js and route-name.svlete retreiving & displaying content from repeatable documents, on problem.

I'm wondering what's now the recommended way to retrieve data for a singleton (e.g. menu) and pass that to a lib/menu.svelte file? (lib/menu.svlete being imported into my main __layout.svelte)

(The Prismic docs on this address doing this in plain Svelte, but not Sveletekit).

Hello @bripirie, the queries should work the same way if you use SvelteKit or Svelte alone. Here we have an example to query it in a nav component using the getSingle() query method:

Thanks Pau, I'll work off the examples you pointed to.

1 Like