@naturalcycles/js-lib 14.267.0 → 14.267.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -124,7 +124,10 @@ class Fetcher {
124
124
  variables: opt.variables,
125
125
  });
126
126
  // Checking the query length, and not allowing to use GET if above 1900
127
- if (opt.method === 'GET' && opt.query.length < 1900) {
127
+ if (opt.method === 'GET' && opt.query.length > 1900) {
128
+ opt.method = 'POST';
129
+ }
130
+ if (opt.method === 'GET') {
128
131
  opt.searchParams = {
129
132
  ...opt.searchParams,
130
133
  ...payload,
@@ -117,7 +117,10 @@ export class Fetcher {
117
117
  variables: opt.variables,
118
118
  });
119
119
  // Checking the query length, and not allowing to use GET if above 1900
120
- if (opt.method === 'GET' && opt.query.length < 1900) {
120
+ if (opt.method === 'GET' && opt.query.length > 1900) {
121
+ opt.method = 'POST';
122
+ }
123
+ if (opt.method === 'GET') {
121
124
  opt.searchParams = {
122
125
  ...opt.searchParams,
123
126
  ...payload,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/js-lib",
3
- "version": "14.267.0",
3
+ "version": "14.267.1",
4
4
  "scripts": {
5
5
  "prepare": "husky",
6
6
  "build": "dev-lib build-esm-cjs",
@@ -194,7 +194,11 @@ export class Fetcher {
194
194
  })
195
195
 
196
196
  // Checking the query length, and not allowing to use GET if above 1900
197
- if (opt.method === 'GET' && opt.query.length < 1900) {
197
+ if (opt.method === 'GET' && opt.query.length > 1900) {
198
+ opt.method = 'POST'
199
+ }
200
+
201
+ if (opt.method === 'GET') {
198
202
  opt.searchParams = {
199
203
  ...opt.searchParams,
200
204
  ...payload,