
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYes, you can absolutely combine multiple GROQ queries into a single request! The key is understanding that the entire structure needs to be one GROQ query string that returns an object with multiple properties, not a JavaScript object containing separate query strings.
Based on the GROQ Query Cheat Sheet, here's the pattern for combining queries:
const combinedQuery = groq`{
"partnerData": *[_type == "partner" && slug.current == "${slug}"][0]{
name,
slug,
h1,
h2,
logo,
"logoAspectRatio": logo.asset->metadata.dimensions.aspectRatio,
undergrad_cosigned,
undergrad_noncosigned,
undergrad_outcomes,
mba,
medical,
dental,
law,
grad
},
"rateData": *[_type == "rates" && name == "December"]
}`;
// Single fetch call
const data = await client.fetch(combinedQuery);
// Access the results
const partnerData = data.partnerData;
const rateData = data.rateData;This works with both client.fetch() and usePreview() because you're passing a single query string that constructs an object containing the results of multiple queries.
Why this approach is better:
The documentation specifically shows this pattern:
{
'featuredMovie': *[_type == 'movie' && title == 'Alien'][0],
'scifiMovies': *[_type == 'movie' && 'sci-fi' in genres]
}So your instinct was correct! Just remember: it's one complete GROQ query string that builds an object, not separate JavaScript strings.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store