@prismicio/client
Advanced tools
Comparing version 6.4.0 to 6.4.1-alpha.0
@@ -486,2 +486,3 @@ import * as prismicH from '@prismicio/helpers'; | ||
const url = new URL(input); | ||
url.searchParams.set("ref", ref); | ||
const query = url.searchParams.get("query"); | ||
@@ -488,0 +489,0 @@ if (query) { |
{ | ||
"name": "@prismicio/client", | ||
"version": "6.4.0", | ||
"version": "6.4.1-alpha.0", | ||
"description": "The official JavaScript + TypeScript client library for Prismic", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1380,5 +1380,2 @@ import * as prismicT from "@prismicio/types"; | ||
// Compress the GraphQL query (if it exists) by removing | ||
// whitespace. This is done to optimize the query size and avoid hitting the | ||
// upper limit of GET requests (2048 characters). | ||
const url = new URL( | ||
@@ -1390,5 +1387,24 @@ // Asserting `input` is a string since popular GraphQL | ||
); | ||
// This prevents the request from being cached unnecessarily. | ||
// Without adding this `ref` param, re-running a query | ||
// could return a locally cached response, even if the | ||
// `ref` changed. This happens because the URL is | ||
// identical when the `ref` is not included. Caches may ignore | ||
// headers. | ||
// | ||
// The Prismic GraphQL API ignores the `ref` param. | ||
url.searchParams.set("ref", ref); | ||
const query = url.searchParams.get("query"); | ||
if (query) { | ||
url.searchParams.set("query", minifyGraphQLQuery(query)); | ||
url.searchParams.set( | ||
"query", | ||
// Compress the GraphQL query (if it exists) by | ||
// removing whitespace. This is done to | ||
// optimize the query size and avoid | ||
// hitting the upper limit of GET requests | ||
// (2048 characters). | ||
minifyGraphQLQuery(query), | ||
); | ||
} | ||
@@ -1395,0 +1411,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
390299
4966
2