GraphQL Api is disabled by default for security reasons, to enable it edit env.php and set GRAPHQL to true.

defined('GRAPHQL') || define('GRAPHQL', true);

From Vvveb folder run

composer require webonyx/graphql-php

Authentication

Authentication is done with HTTP Authorization or Bearer tokens using any admin user credentials that has GraphQL role permissions.

curl -i -H 'Content-Type: application/json' -H "Authorization: Bearer mytoken" -X POST -d '{"query":"{ posts { nodes { postId name content } } }"}' 'https://demo.vvveb.com/graphql' 
curl --user demo:demo -i -H 'Content-Type: application/json' -X POST --data-raw '{"query":"{ posts { nodes { postId name content } } }"}' 'https://demo.vvveb.com/graphql' 

Permissions

Permission can be controlled from admin user roles and can be set for both resource and action.

GraphQL IDE

An interactive in-browser GraphQL IDE is provided by the GraphQL plugin https://plugins.vvveb.com/product/graphql

Vercel Next.js Commerce

Vercel Next.js Commerce headless store implemented using Vvveb GraphQL API https://github.com/givanz/vercel-vvveb-commerce

Demo vercel-vvveb-commerce.vercel.app