Recommendations for protecting and syncing REST API resources and query library

We are self-hosting two Retool deployments, synced through a shared Github repository and the resource protection feature. I've started protecting query library objects and a REST API resource, and I was wondering if there are better ways to achieve a couple of things:

  1. When protecting the REST API resource, it includes the URL in the values, but the target API is a different host in one deployment vs. the other (eg. test + prod). Once synced, we can manually edit the URL for the REST API resource in the prod environment, but is there a better way to manage this?
  2. When protecting the query library objects that are used within apps, the workflow is a little disjointed in that it seems like we need to open a pull request for each query library object, and then another one for the app that is using them. Is there a way to pull all of this together into a single PR to streamline the developer workflow?

I'm also interested in learning any recommendations you may have related to the workflow we are exploring above.

Thank you.

2 Likes

Hi @David_Jetter! Welcome to the community. :slightly_smiling_face:

My number one piece of advice for orgs with a multi-instance setup is to first assign each instance a descriptive configuration variable, so that you can programmatically differentiate between them via code.

Unfortunately, though, there isn't a way to dynamically set the "Base URL" when configuring a "REST API" resource. The workaround is to leave that particular field blank and they dynamically define it within the query editor, instead.

In a similar fashion, you could also configure to separate resources and define your query to dynamically switch between using the two.

Both solutions put a bit more of a burden on your app builders to construct the queries appropriately, but the result is that you shouldn't need any manual editing when syncing across instances. This is a common point of confusion and honestly an area where we can improve. The docs here do a pretty good job of outlining your options, as well!

To your second question, I don't think there's currently a more streamlined option. I know it's possible to edit and update a variety of entities on a single branch, but that doesn't seem to be possible when initially protecting them. :thinking: The good news is that those PRs should never have any conflicts and can be merged automatically.