What type of query is this? Typically you’ll see this type of error when you use a dynamic table name inside of a SQL Resource query (mssql, mysql, etc). If you select Resource type “Query JSON with SQL,” it should allow you to run this query.
If query1 is a SQL query, you may also need to format the data using {{formatDataAsArray(query1.data)}}. Let us know if you have questions! You can also read more about this in our docs: https://docs.retool.com/docs/sql-queries#security