Merged in feature/turbopack (pull request #3117)

Feature/turbopack

* .

* .

* pin import-in-the-middle

* update marker

* revert back to using *.graphql.ts


Approved-by: Linus Flood
This commit is contained in:
Joakim Jäderberg
2025-11-11 09:51:40 +00:00
parent ecb25cf6cd
commit bc5a606289
347 changed files with 12780 additions and 9059 deletions

View File

@@ -29,31 +29,6 @@ export async function request<T>(
client.requestConfig.cache = params?.cache
client.requestConfig.next = params?.next
if (env.PRINT_QUERY) {
const print = (await import("graphql/language/printer")).print
const rawResponse = await client.rawRequest<T>(
print(query as DocumentNode),
variables,
{
access_token: env.CMS_ACCESS_TOKEN,
"Content-Type": "application/json",
}
)
/**
* TODO: Send to Monitoring (Logging and Metrics)
*/
requestLogger.debug("complexity", {
complexityLimit: rawResponse.headers.get("x-query-complexity"),
referenceDepth: rawResponse.headers.get("x-reference-depth"),
resolverCost: rawResponse.headers.get("x-resolver-cost"),
})
return {
data: rawResponse.data,
}
}
try {
// @ts-expect-error: query can be undefined (?)
const operationName = (query as DocumentNode).definitions.find(
@@ -140,6 +115,7 @@ export async function request<T>(
`[gql] Error sending graphql request to ${env.CMS_URL}`,
error
)
throw new Error("Something went wrong")
throw new Error("Failed to fetch data from CMS", { cause: { error } })
}
}