I don't know for sure, but I don't think that the maptips are really generated on the fly. Keep in mind that (USUALLY) you bind the data in the xaml. So I assume (always dangerous to do so) that the actual generation is done under the hood, and it's not possible to tie a query to the maptip.
I think your best would be to dynamically create a maptip for each graphic. Unfortunately this means having to loop through each and every graphic that will have a maptip and assign the maptip value to the result of the specified query. This also means that you have to run the query for each graphic.