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:
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