A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
You talk about 3 things and everything mixed up.
A query as connection only does not refresh, can not be refreshed and there is never a need to refresh, because queries in general do not contain any data!
This kind of queries can be called from other queries and so read / deliver the data to the other query.
You can also create a query as connection only and load the data into the Data Model and if the Data Model is refreshed the query is called to deliver the data. This works automatically with the default settings.
It is possible to exclude queries from automatic refreshing in the query options.
Finally if you create a Pivot table from the Data Model and refresh the Pivot table, the "refresh call" goes also to the data model which calls the query to update the data...
If you need further help I need to see your (sample) file.
Why a sample file is important for troubleshooting. How to do it. - Microsoft Community
The article also contains a link to a macro that you can use to anonymize your data.
Andreas.