Gato GraphQL logo

Automation

Automation

Automatically execute a GraphQL Persisted Query when some event happens on the site, via an "automator" user interface.

The automation trigger is any WordPress action hook, and the action is the execution of a GraphQL persisted query.

Automation Rule editor
Automation Rule editor

For instance, when creating a new post, automation rule Add comments block to new post checks if the core/comments block is present and, if not, it adds it at the bottom of the post:

Automatically inserting the comments block to new 'draft' posts
Automatically inserting the comments block to new 'draft' posts

This extension also provides action hooks to be invoked from within WP-Cron:

  • gatographql__execute_query
  • gatographql__execute_persisted_query

You can also add a hook in your application's PHP code, to react to the resolution of a GraphQL query, via the following action hooks:

  1. gatographql__executed_query:{$operationName}
  2. gatographql__executed_query