I figured it out before but thanks for your reply! I tried what you suggested It didn't, just seeing how many ways it can be done. Yea I got it to work and did wrap my initial query in there and it worked, the query via client and online sanity. For those who are reading, this worked for me, to get the latest data because for some reason sanityClient.fetch doesn't give me the latest data after closing the tab, and coming back fresh data is not there even though it's in the database, in nextjs, unless you reload page.
const baseUrl =
https://${process.env.NEXT_PUBLIC_SANITY_PROJECT_ID}.<http://api.sanity.io/v2022-05-10/data/query/development?query=|api.sanity.io/v2022-05-10/data/query/development?query=>
const userTweetsQuery = encodeURIComponent(
*[_type == "tweet" && userId == '${userId}'] | order(_createdAt desc)
);
fetch(
${baseUrl}${userTweetsQuery}
) .then(res => res.json())
.then(userTweets => {
console.log(userTweets)
})
.catch(error => {console.log(error.message)})