Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 756 Bytes

README.md

File metadata and controls

33 lines (22 loc) · 756 Bytes

WP Blocks with GraphQL

This repository explores a possible aproximation on how to use GraphQL within blocks. The intention of unify and simplify database access from both the server and the client (the editor, in this case).

It consists of three blocks:

  • One parent block that request a query.
  • Two children blocks that use fragments to extend the parent's query.

This experiment has the following dependencies:

Set up

Install NPM dependencies.

npm install

Install the WPGraphQL plugin.

npx wp-env run cli wp plugin install wpgraphql

Start the project.

npx wp-env start
npm start