2 Problematic Behaviors with Saved Queries

If I take an existing resource query and use "Extract to Query Library", the modified version will be using a different query from the library under the hood

(Before extracting)

(After extracting)

(After converting to regular query): You can see it's a different query

I've noticed that the 2nd screen is only shown in this scenario. However If import a query from the library, then it will look completely different like this, where I can see which query is selected, but don't have the ability to extract it (which I would like):

Hello @henrymeiklejohn!

Thank you for finding this bug and bringing it up!

I was able to reproduce this issue and will be logging a ticket for our engineers to fix it.

My queries were also getting changed to the restcountries.com URL when I followed your steps of creating a query in the app editor and then Extracting to the Query Library.

It seems that the permissions might be the cause, where the "Convert to regular query" button is somehow unable to access the query, and thus defaults to the same URL as this URL was also the one used in our docs for examples.

In the meantime, if you create a query in the Query Library instead of the app builder, you can then choose the "Import from Query Library" option and to get the correct query (after you click "share query" in the Query Library).

To your final point, could I ask about why you want to extract a query that you are importing from the library? It seems that the purpose of the missing "extract query to query library" button is to move a query from it's creation inside the app builder/editor to the library, but if it is already in the library then that action would be redundant.

Glad to hear about the ticket.

I realized I was mixing up terms a bit in my post. "Convert to regular query" is the feature I'm looking for. And that button is only present for the specific sequence and not elsewhere.

My use case is that sometimes I need to build a query and don't want to start from scratch. It's quicker to duplicate and then modify an existing one.

This only works within an app though, I can't do this between apps (I think). So I'd like to be able to save a query, then import it to another app, and then convert it to a regular query to make modifications.

  1. Yes it would also be nice to have the flexibility to build queries from an app then extract OR build from the query library.

  2. Building a query in an app then extracting, and then converting to a regular query isn't a real use case I would actually use. That was more just me troubleshooting.

Hey @henrymeiklejohn,

If you want to re-use a common query or modify it for specific apps, you should be able to do this from the Query Library.

The issue you mentioned with not being able to edit queries that are being imported into an app from the Query Library is an issue I just ran into when replicating.

To your point on wanting to build query in app, import to another app, then modify, the code might end up mutating the original query that was first created. The way to avoid this is using the "Duplicate Query" option in the Query Library.

As outlined in the docs here, the Query Library is the best and easiest way to share queries across multiple Retool Apps.

Once you build an query in the Query Library, there will be a button in the top right corner to share it and then you can select them inside the app. Next to the share button will be the triple dot icon where you can click.

Let me know if that workaround workflow helps you and if you have any more suggestions for improving the Query Library feel free to share!