Skip to content

Commit e9fc2a6

Browse files
committed
upd
1 parent a533f59 commit e9fc2a6

6 files changed

Lines changed: 34 additions & 5 deletions

File tree

packages/basehub/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# basehub
22

3+
## 9.4.0
4+
5+
### Minor Changes
6+
7+
- change pump endpoint to new one
8+
9+
### Patch Changes
10+
11+
- improve error message
12+
313
## 9.3.9
414

515
### Patch Changes

packages/basehub/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "basehub",
33
"description": "A very fast Headless CMS.",
44
"author": "JB <jb@basehub.com>",
5-
"version": "9.3.9",
5+
"version": "9.4.0",
66
"license": "MIT",
77
"repository": "basehub-ai/basehub",
88
"bugs": "https://github.com/basehub-ai/basehub/issues",

packages/basehub/src/genql/runtime/_error.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
export class GenqlError extends Error {
22
errors: Array<GraphqlError> = [];
3+
errorsStringified?: string;
4+
extraWarnings?: string;
35
/**
46
* Partial data returned by the server
57
*/
68
data?: any;
7-
constructor(errors: any[], data: any) {
9+
constructor(errors: any[], data: any, extraWarnings?: string) {
810
let message = Array.isArray(errors)
911
? errors.map((x) => x?.message || "").join("\n")
1012
: "";
@@ -14,6 +16,8 @@ export class GenqlError extends Error {
1416
super(message);
1517
this.errors = errors;
1618
this.data = data;
19+
this.errorsStringified = JSON.stringify(errors, null, 2).slice(0, 1000);
20+
this.extraWarnings = extraWarnings;
1721
}
1822
}
1923

packages/basehub/src/react/pump/server-pump.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const Pump = async <
9999
const { headers, draft, resolvedRef } = await getStuffFromEnv(basehubProps);
100100
const { "x-basehub-token": _token, ...headersWithoutToken } = headers;
101101
const apiVersion = headers["x-basehub-api-version"];
102-
const pumpEndpoint = "https://aws.basehub.com/pump";
102+
const pumpEndpoint = "https://pump-router.basehub.com/graphql";
103103

104104
const noQueries = queries.length === 0;
105105

@@ -151,7 +151,14 @@ export const Pump = async <
151151
responseHashes[index] = _responseHash;
152152

153153
if (_errors?.length) {
154-
throw new GenqlError(_errors || [], data);
154+
throw new GenqlError(
155+
_errors || [],
156+
data,
157+
headers["x-basehub-ref"] &&
158+
headers["x-basehub-ref"] !== resolvedRef.ref
159+
? `⚠️ Not fetching from "${resolvedRef.ref}", but actually from "${headers["x-basehub-ref"]}" (probably due to a branch cookie set with the Toolbar).`
160+
: undefined
161+
);
155162
}
156163

157164
return replaceSystemAliases(data);

playground/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# playground
22

3+
## 0.0.255
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- Updated dependencies
9+
- basehub@9.4.0
10+
311
## 0.0.254
412

513
### Patch Changes

playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "playground",
33
"private": true,
4-
"version": "0.0.254",
4+
"version": "0.0.255",
55
"scripts": {
66
"dev": "next dev --port 3003",
77
"build": "next build",

0 commit comments

Comments
 (0)