strapi-nextgen-framework
Version:
Production-ready, type-safe framework bridging Strapi v4 CMS and Next.js 14+ App Router with automatic cache management, Error Boundaries, and SEO optimization
22 lines • 730 B
JavaScript
/**
* Fetch wrapper with automatic cache tagging
* Wraps Next.js fetch to inject cache tags automatically
*/
/**
* Creates a fetch function that automatically adds cache tags
* This is used by graphql-request to make requests with Next.js caching
*
* @param logging - Optional logging configuration
* @returns Wrapped fetch function
*/
export function createCacheTaggedFetch(logging) {
return async (input, init) => {
// Log cache tags if enabled
if (logging?.cacheTags && init?.next) {
console.log('[Strapi SDK] Cache tags:', init.next);
}
// Call Next.js fetch with cache configuration
return fetch(input, init);
};
}
//# sourceMappingURL=fetch-wrapper.js.map