Gato GraphQL

Product details

Q: Access Wordpress filesystem?

Can it access the filesystem too? Specifically, the lifetime version of WPCodeBox stores snippets in the filesystem, but doesn't provide Cloud Storage. However, can Gato GraphQL read from and write to the filesystem, so that we can easily backup and apply changes to any of our websites?

GarethPLUSMar 19, 2025
Founder Team
Leonardo_GatoGraphQL

Leonardo_GatoGraphQL

Mar 19, 2025

A: Technically yes, but I haven't coded any field that does that yet, as it's a potential security hazard. But it's totally doable.

If you're up to the task, you can add a FieldResolver with a field "readFile" that you pass a path, and will load the contents of that file. Same for a `writeToFile` field. Check the ExtensionStarter repo to create your own resolvers: https://github.com/GatoGraphQL/ExtensionStarter

Btw, I'm currently experimenting with using Cursor AI to create extensions. If it works well, creating an extension like the one you need may take just a couple of hours, or even less. If you're interested, and want to be kept in the loop, let me know.

Share
Helpful?
Log in to join the conversation
GarethGarethPLUS
Posted: Mar 19, 2025

Absolutely interested - please keep me in the loop, thanks. Would this be able to return a list of sub-directories & files in a given directory? How about all directories and files are blacklisted by default, but the Wordpress admin can choose what to whitelist (setting)?

Founder
Posted: Mar 19, 2025

It can do anything you want, as long as it's coded via a resolver. And yes, Gato GraphQL has settings, so you could define to white/blacklist files, it's really up to you.

To stay in the loop, the best way is to subscribe to the newsletter, I'll communicate there if/when creating extensions with AI works and how to do it: https://gatographql.com/newsletter