Headless WordPress with GraphQL and SvelteKit

Click for: original source

Headless WordPress + GraphQL + SvelteKit as any other stack where you have a backend (data store), a frontend (the website), and a way to connect the two. In this case, the backend is WordPress, the frontend is SvelteKit and the way to connect the two is GraphQL. By Justin Ahinon.

This guide then will explain:

  • Why even use WordPress in headless mode?
  • How would that work?
  • Setting up WordPress
  • Creating a type-safe GraphQL client in SvelteKit

Since the visual presentation will be handled by SvelteKit, we will use WordPress to store our data; posts, pages, custom post types, custom fields, etc. There are code examples also included. Good read!

[Read More]

Tags apis app-development web-development php javascript