Skip to content
WP Engine |Headless Platform

SvelteKit Template Hierarchy with URQL

In this example we show how to implement the WordPress Template Hierarchy in SvelteKit for use with a Headless WordPress backend using WPGraphQL. We use URQL for all routing and fetching page content.

  1. Run npm run example:setup to install dependencies and configure the local WP server.
  2. Run npm run example:start to start the WP server and SvelteKit development server.

To reset the WP server and re-run setup you can run npm run example:prune and confirm “Yes” at any prompts.