next.jsfetch-apisanity

NextJS / Sanity Fetch Logs


I keep getting verbose console output when using Sanity's fetch() function (from createClient in next-sanity) like so:

export async function getPeople(): Promise<Person[]> {
  return createClient(clientConfig).fetch(
    groq`*[_type == "person"] | order(priority asc, lastName asc){
     ...
    }`
  );
}

Logs look like this:


-  ┌ GET /research/publications 200 in 740ms
   │
   ├──── GET https://...apicdn.../v2023-07-07/data/query/..?query=*%5B_type.. 200 in 284ms (cache: MISS)
   │
   ├── 1 level ── GET https://...apicdn.../v2023-07-07/data/query/..?query=array%3A%.. 200 in 113ms (cache: MISS)
   │
   ├── 1 level ── GET https://...apicdn.../v2023-07-07/data/query/..?query=array%3A%.. 200 in 68ms (cache: MISS)
   │
   ├── 1 level ── GET https://...apicdn.../v2023-07-07/data/query/..?query=array%3A%.. 200 in 78ms (cache: MISS)
   │
   └── 1 level ── GET https://...apicdn.../v2023-07-07/data/query/..?query=array%3A%.. 200 in 71ms (cache: MISS)

People over at the Sanity community suggest its a NextJS thing.

Any help on how to disable them is greatly appreciated!


Solution

  • For anyone stumbling across this, the issue was resolved by updating packages next, next-sanity, and sanity.