Create resource queries

1. Navigate back to the home page:

2. Edit the Sample Users Page:

3. Delete all the resource queries shown by clicking on the 3 side buttons next to the query name, users, and clicking on the Delete button:

4. Add a new resource query by clicking on the New drop-down and choosing the Resource query option:

5. Once you add the new query, pick the resource we created earlier, rockset-base-API:

6. Choose the POST under Action type:

PAGE SWITCH: We'll be grabbing the API endpoint on Rockset

7. Rockset side: After the base URL, copy the endpoint of the second half of the URL that we didn’t use when we created the resource rockset-base-API: /GetAllUsers/tags/latest

PAGE SWITCH: We'll be putting the API endpoint on Retool

8. Retool side: Paste the API endpoint we just grabbed and put it in the second box of the resource:

9. Rename the resource query GetAllUsers (naming has to be camel case) and Run it:

10. If you get any errors, check to make sure the resource query was created correctly, you have the right API key, and so on.

11. REPEAT steps 4-10: Do this for all the query lambdas we created on Rockset. The query names should be the same name as the Query Lambdas. When you’re done, your resource queries should be successful (when you run and test it) and look like this:


You'll notice some Rockset queries require parameters. The queries that require parameters should run successfully without adding them on Retool because there is a default value associated with each query.

We'll add parameters in the query resource in Retool in the next section- don't worry about it now.

NOTE: You can find us on the Rockset Community if you have questions or comments about the workshop.

Last updated