Augment WordPress search capabilities
Sometimes searching for data within WordPress is limited, as with custom fields: Searching in WordPress for posts that contain some keyword will not search within meta values.
Gato GraphQL can complement these capabilities, allowing us to search for posts (and also users, comments, and taxonomies) by meta key and value (including via regex expressions).
Query dynamic data
Gato GraphQL provides "function" fields, allowing us to compute logic already within the GraphQL query, thus avoiding the need to code a client application.
This way, we can dynamically compute data, input it back into the query, and affect the response with granular control. For instance, we can compute the date "24hs ago" and search for comments added from this date onwards.
Gato GraphQL can empower WP-CLI, by helping us find the WordPress data we need with granular control, and then injecting into the WP-CLI command (to update a post or user, reply to a comment, delete an option, etc).
We can even retrieve the data from multiple resources at once, and execute WP-CLI on all of them.
For instance, we can select all users with any Spanish locale, and update their locale to Spanish from Argentina.
Send personalized emails
Gato GraphQL allows us to execute mutations under any type from the GraphQL schema (i.e. not only under the Root type).
We can then iterate the list of users, obtain their data (name, email and a meta value with the number of remaining credits), dynamically compose a message using Markdown, and send a personalized email to the user.
Power blocks with DRY logic (for CSR/SSR)
Gato GraphQL allows to have a single source of truth to fetch data for both the client and server-sides, making this logic DRY (Don't Repeat Yourself).
Gato GraphQL provides fields to query the properties from (Gutenberg) blocks.
Duplicate a blog post
Duplicating a post is an example of Gato GraphQL's ability to retrieve, manipulate and store again data in the site.
You have the ultimate control on how the post will be duplicated. Change the author or post status, append "(Copy)" to the title, or any other.
Customize content for different users
We can retrieve a different response in a field depending on some piece of queried data, such as the roles of the logged-in user.
For instance, the post content can append an "Edit this post" link at the bottom of the content for the admin user only.
Adapt content in bulk
Gato GraphQL allows us to execute a mutation on hundreds or even thousands of resources at once.
Migrate the domain, or a post or page slug, in all content
After migrating the site to a new domain, or changing the slug of a post or page, we can convert all content throughout the site to point to the new URL.
Insert/remove a block in bulk
We can update posts by modifying their (Gutenberg) block's HTML content, and we can do it in bulk.
This is useful for promoting campaigns, inserting a custom block with our Call To Action to all posts in the website, and removing it from everywhere right after the campaign ends.
Retrieve structured data from blocks
We can iterate the (Gutenberg) blocks in the post and extract the attributes from deep within the block structure, unlocking these attributes to be fed into any functionality in our site, and to be exposed via an API to power our other applications (mobile app, newsletter, etc).
For instance, by extracting all the image URLs contained in the core/image blocks in a post, we can create an image carousel with all these images.
Gato GraphQL can help us automate tasks in the application, such as sending a notification email when a comment is added, automatically adding a mandatory block to a new post, pinging external services on some activity, and others.
Gato GraphQL can also be integrated with WP-Cron, allowing us to execute GraphQL queries that run some admin task on a timely basis.
Interact with external services
Gato GraphQL provides fields to execute HTTP requests against a webserver, allowing us to interact with external services and APIs.
For instance, we can retrieve the list of subscribers from a Mailchimp list, combine those records with the user data in the site, and execute an action with the augmented data.
Filter data from an external API
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.