Gato GraphQL is a productivity tool for interacting with data in your WordPress site. You can think of it as a Swiss Army knife for dealing with data in a WordPress site, as it allows to retrieve, manipulate and store again any piece of data, in any desired way.
Examples on using Gato GraphQL to search for posts (and also users, comments, and taxonomies) by meta key and value.
Gato GraphQL allows us to dynamically compute data, input it back into the query, and affect the response with granular control. Here is how.
Gato GraphQL expands enables exposing multiple custom endpoints, each of them tailored to some specific need, and these can be made private and public. When should we use each?
Recipe on how to use Gato GraphQL to find the data we need, and then inject it into WP-CLI.
Recipe on retrieving multiple user IDs while executing a single GraphQL query, and injecting these into WP-CLI.
Content in the the WordPress editor is created via (Gutenberg) blocks, which fetch their data from the server via an API. WordPress core uses the WP REST API, but we can also use Gato GraphQL to power our own blocks.
Recipe showing how to use Gato GraphQL to have a single source of truth to fetch data for both the client and server-sides when rendering Gutenberg blocks.
Duplicating a post is an example of Gato GraphQL's ability to retrieve, manipulate and store again data in the site.
Recipe on duplicating multiple posts with a single GraphQL request.
Recipe on retrieving a different response in a field depending on some piece of queried data, such as the roles of the logged-in user.
Examples of content adaptations involving search and replace, and then storing the resource back to the DB.
Recipe on adapting content in bulk, updating the title and excerpt for multiple posts with a single GraphQL request.
We can execute a batch of GraphQL queries to adapt the content in the site when migrating it to a new domain, moving pages to a different URL, or others.
Recipe on updating posts by modifying their (Gutenberg) block's HTML content, useful for adding a block to all posts in the site before a campaign, and removing it right afterwards.
Recipe on iterating the (Gutenberg) blocks in the post and extracting the attributes from deep within the block structure, as to unlock these attributes to be fed into any functionality in our site.
Recipe on translating a post to the desired language, with full support for (Gutenberg) blocks.
Recipe for translating multiple posts at once (in bulk), while executing a single call to the Google Translate API containing all text to translate from all the posts.
Recipe on iterating the inner structure of (Gutenberg) blocks, extracting desired items, modifying them, and storing them again in the DB.
Recipes demonstrating several capabilities by Gato GraphQL to send emails.
Integrating Gato GraphQL with WP-Cron, as to automate the execution GraphQL queries that perform admin tasks, with some time interval.
Examples on automating tasks in the application, such as sending a notification email to the admin when there is a new post.
Whenever a new post is created, we can use the automation features to validate and modify the content of the post. This recipe checks if a certain mandatory block is present in the post and, whenever missing, it adds it.
Recipe on creating Persisted Queries that act as webhooks.
Recipe on fetching data from an external API using the HTTP Client fields.
Recipe on retrieving credentials from an environment value, as to avoid them getting printed in the response or logs, thus avoiding security risks.
Recipe on combining the data from two or more sources, and then executing some operation with the combined data.
How to skip executing the rest of the GraphQL query after an error occurs.
Recipe on creating an API gateway that retrieves the latest artifacts from the GitHub Actions API, and extracts their URL to be downloaded, avoiding the need for the client to be signed in to GitHub.
Combining HTTP requests with calling the Google Translate API, we can translate the content from any URL.
Examples on adapting the response from an external API to anything we need it to be.
If the external API does not allow filtering by a certain property that we need, we can use Gato GraphQL to iterate over the entries in the API response, and remove those ones that do not satifsy our condition.
Recipe on pinging external services about new resources added to our website, passing along data both stored in the website and/or provided via parameters or headers.
How to update thousands of resources in a single action.
Recipe on how we can keep WordPress sites in sync, by importing a post from some WordPress site into our local WordPress site.
Recipe on implementing a distributed server architecture using Gato GraphQL extensions on the upstream WordPress site only.
Using InstaWP + Gato GraphQL to forward webhook data into an API.