leoloso/graphiql-wp-block

WordPress block for adding a GraphiQL client, to query the GraphQL server


README

WordPress block for adding a GraphiQL client, to query the GraphQL server

Usage

Include in your project through Composer:

$ composer require leoloso/graphiql-wp-block dev-master

Note: Your composer.json file must have the configuration below to accept minimum stability "dev" (there are no releases for PoP yet, and the code is installed directly from the master branch):

{
    ...
    "minimum-stability": "dev",
    "prefer-stable": true,
    ...
}

Then, initialize by running:

(new \Leoloso\GraphiQLWPBlock\Block($graphiQLURLPath))->init();

$graphiQLURLPath is a string containing the URL path to the block. From a plugin, it can be calculated like this:

$graphiQLPath = 'vendor/leoloso/graphiql-wp-block';
$graphiQLURLPath = \plugins_url($graphiQLPath, __FILE__);

Credits

License

The MIT License (MIT). Please see License File for more information.