@cedarjs/web 0.6.1-next.0 → 0.7.0
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.
- package/dist/apollo/index.d.ts +2 -3
- package/dist/apollo/index.d.ts.map +1 -1
- package/dist/apollo/index.js +5 -6
- package/dist/cjs/apollo/index.d.ts +2 -3
- package/dist/cjs/apollo/index.d.ts.map +1 -1
- package/dist/cjs/apollo/index.js +11 -9
- package/dist/cjs/bundled/apollo-upload-client.js +1 -1
- package/package.json +8 -8
package/dist/apollo/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ApolloClientOptions, setLogVerbosity, ApolloCache, InMemoryCacheConfig, HttpOptions, DocumentNode } from '@apollo/client';
|
|
3
|
-
import { ApolloLink } from '@apollo/client';
|
|
4
|
-
import type { HttpLink } from '@apollo/client/link/http/http.cjs';
|
|
2
|
+
import type { ApolloClientOptions, setLogVerbosity, ApolloCache, InMemoryCacheConfig, HttpOptions, DocumentNode, HttpLink } from '@apollo/client';
|
|
3
|
+
import { ApolloLink } from '@apollo/client/link/core/core.cjs';
|
|
5
4
|
import type { UseAuth } from '@cedarjs/auth';
|
|
6
5
|
import './typeOverride.js';
|
|
7
6
|
import { fragmentRegistry, registerFragment, registerFragments } from './fragmentRegistry.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apollo/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apollo/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,QAAQ,EACT,MAAM,gBAAgB,CAAA;AA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E,uBAAuB,CAAA;IACrC;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,wBAAwB,CAAA;CAC7C,CAAA;AAqND,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAC1D,mBAAmB,CAAC,EAAE,uBAAuB,CAAA;IAC7C,SAAS,CAAC,EAAE,YAAY,EAAE,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;IAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CA2CA,CAAA"}
|
package/dist/apollo/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { InMemoryCache } from "@apollo/client/cache/cache.cjs";
|
|
2
3
|
import {
|
|
3
|
-
ApolloProvider,
|
|
4
4
|
ApolloClient,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
ApolloLink
|
|
8
|
-
} from "@apollo/client";
|
|
9
|
-
import { setLogVerbosity as apolloSetLogVerbosity } from "@apollo/client/core/core.cjs";
|
|
5
|
+
setLogVerbosity as apolloSetLogVerbosity
|
|
6
|
+
} from "@apollo/client/core/core.cjs";
|
|
10
7
|
import { setContext } from "@apollo/client/link/context/context.cjs";
|
|
8
|
+
import { ApolloLink, split } from "@apollo/client/link/core/core.cjs";
|
|
11
9
|
import { createPersistedQueryLink } from "@apollo/client/link/persisted-queries/persisted-queries.cjs";
|
|
12
10
|
import {
|
|
13
11
|
useQuery,
|
|
@@ -17,6 +15,7 @@ import {
|
|
|
17
15
|
useReadQuery,
|
|
18
16
|
useSuspenseQuery
|
|
19
17
|
} from "@apollo/client/react/hooks/hooks.cjs";
|
|
18
|
+
import { ApolloProvider } from "@apollo/client/react/react.cjs";
|
|
20
19
|
import { getMainDefinition } from "@apollo/client/utilities/utilities.cjs";
|
|
21
20
|
import { print } from "graphql/language/printer.js";
|
|
22
21
|
import { useNoAuth } from "@cedarjs/auth";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ApolloClientOptions, setLogVerbosity, ApolloCache, InMemoryCacheConfig, HttpOptions, DocumentNode } from '@apollo/client';
|
|
3
|
-
import { ApolloLink } from '@apollo/client';
|
|
4
|
-
import type { HttpLink } from '@apollo/client/link/http/http.cjs';
|
|
2
|
+
import type { ApolloClientOptions, setLogVerbosity, ApolloCache, InMemoryCacheConfig, HttpOptions, DocumentNode, HttpLink } from '@apollo/client';
|
|
3
|
+
import { ApolloLink } from '@apollo/client/link/core/core.cjs';
|
|
5
4
|
import type { UseAuth } from '@cedarjs/auth';
|
|
6
5
|
import './typeOverride.js';
|
|
7
6
|
import { fragmentRegistry, registerFragment, registerFragments } from './fragmentRegistry.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/apollo/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/apollo/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,QAAQ,EACT,MAAM,gBAAgB,CAAA;AAOvB,OAAO,EAAE,UAAU,EAAS,MAAM,mCAAmC,CAAA;AAcrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAG5C,OAAO,mBAAmB,CAAA;AAQ1B,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,QAAQ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1D,mBAAmB,CAAC,EAAE,uBAAuB,CAAA;IAC7C,SAAS,CAAC,EAAE,YAAY,EAAE,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;IAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CA2CA,CAAA"}
|
package/dist/cjs/apollo/index.js
CHANGED
|
@@ -36,11 +36,13 @@ __export(apollo_exports, {
|
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(apollo_exports);
|
|
38
38
|
var import_react = __toESM(require("react"), 1);
|
|
39
|
-
var
|
|
39
|
+
var import_cache = require("@apollo/client/cache/cache.cjs");
|
|
40
40
|
var import_core = require("@apollo/client/core/core.cjs");
|
|
41
41
|
var import_context = require("@apollo/client/link/context/context.cjs");
|
|
42
|
+
var import_core2 = require("@apollo/client/link/core/core.cjs");
|
|
42
43
|
var import_persisted_queries = require("@apollo/client/link/persisted-queries/persisted-queries.cjs");
|
|
43
44
|
var import_hooks = require("@apollo/client/react/hooks/hooks.cjs");
|
|
45
|
+
var import_react2 = require("@apollo/client/react/react.cjs");
|
|
44
46
|
var import_utilities = require("@apollo/client/utilities/utilities.cjs");
|
|
45
47
|
var import_printer = require("graphql/language/printer.js");
|
|
46
48
|
var import_auth = require("@cedarjs/auth");
|
|
@@ -59,7 +61,7 @@ const ApolloProviderWithFetchConfig = ({ config, children, useAuth = import_auth
|
|
|
59
61
|
mostRecentRequest: void 0,
|
|
60
62
|
mostRecentResponse: void 0
|
|
61
63
|
};
|
|
62
|
-
const updateDataApolloLink = new
|
|
64
|
+
const updateDataApolloLink = new import_core2.ApolloLink((operation, forward) => {
|
|
63
65
|
const { operationName, query, variables } = operation;
|
|
64
66
|
data.mostRecentRequest = {};
|
|
65
67
|
data.mostRecentRequest.operationName = operationName;
|
|
@@ -76,7 +78,7 @@ const ApolloProviderWithFetchConfig = ({ config, children, useAuth = import_auth
|
|
|
76
78
|
return { token };
|
|
77
79
|
});
|
|
78
80
|
const { headers, uri } = (0, import_FetchConfigProvider.useFetchConfig)();
|
|
79
|
-
const authMiddleware = new
|
|
81
|
+
const authMiddleware = new import_core2.ApolloLink((operation, forward) => {
|
|
80
82
|
const { token } = operation.getContext();
|
|
81
83
|
const authHeaders = token ? {
|
|
82
84
|
"auth-provider": authProviderType,
|
|
@@ -99,7 +101,7 @@ const ApolloProviderWithFetchConfig = ({ config, children, useAuth = import_auth
|
|
|
99
101
|
// The upload link types don't match the ApolloLink types, even though it comes from Apollo
|
|
100
102
|
// because they use ESM imports and we're using the default ones.
|
|
101
103
|
});
|
|
102
|
-
const uploadOrSSELink = typeof SSELink !== "undefined" ? (0,
|
|
104
|
+
const uploadOrSSELink = typeof SSELink !== "undefined" ? (0, import_core2.split)(
|
|
103
105
|
({ query }) => {
|
|
104
106
|
const definition = (0, import_utilities.getMainDefinition)(query);
|
|
105
107
|
return isSubscription(definition) || isLiveQuery(definition);
|
|
@@ -112,7 +114,7 @@ const ApolloProviderWithFetchConfig = ({ config, children, useAuth = import_auth
|
|
|
112
114
|
}),
|
|
113
115
|
uploadLink
|
|
114
116
|
) : uploadLink;
|
|
115
|
-
const terminatingLink = (0,
|
|
117
|
+
const terminatingLink = (0, import_core2.split)(
|
|
116
118
|
({ query }) => {
|
|
117
119
|
const documentQuery = query;
|
|
118
120
|
return documentQuery?.["__meta__"]?.["hash"] !== void 0;
|
|
@@ -129,11 +131,11 @@ const ApolloProviderWithFetchConfig = ({ config, children, useAuth = import_auth
|
|
|
129
131
|
{ name: "httpLink", link: terminatingLink }
|
|
130
132
|
];
|
|
131
133
|
let link = redwoodApolloLink;
|
|
132
|
-
link ??=
|
|
134
|
+
link ??= import_core2.ApolloLink.from(redwoodApolloLinks.map((l) => l.link));
|
|
133
135
|
if (typeof link === "function") {
|
|
134
136
|
link = link(redwoodApolloLinks);
|
|
135
137
|
}
|
|
136
|
-
const client = new
|
|
138
|
+
const client = new import_core.ApolloClient({
|
|
137
139
|
// Default options for every Cell. Better to specify them here than in `beforeQuery` where it's too easy to overwrite them.
|
|
138
140
|
// See https://www.apollographql.com/docs/react/api/core/ApolloClient/#example-defaultoptions-object.
|
|
139
141
|
defaultOptions: {
|
|
@@ -158,7 +160,7 @@ const ApolloProviderWithFetchConfig = ({ config, children, useAuth = import_auth
|
|
|
158
160
|
error["mostRecentResponse"] = data.mostRecentResponse;
|
|
159
161
|
throw error;
|
|
160
162
|
};
|
|
161
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
163
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react2.ApolloProvider, { client }, /* @__PURE__ */ import_react.default.createElement(ErrorBoundary, { onError: extendErrorAndRethrow }, children));
|
|
162
164
|
};
|
|
163
165
|
class ErrorBoundary extends import_react.default.Component {
|
|
164
166
|
componentDidCatch(...args) {
|
|
@@ -180,7 +182,7 @@ const RedwoodApolloProvider = ({
|
|
|
180
182
|
if (fragments) {
|
|
181
183
|
import_fragmentRegistry.fragmentRegistry.register(...fragments);
|
|
182
184
|
}
|
|
183
|
-
const cache = new
|
|
185
|
+
const cache = new import_cache.InMemoryCache({
|
|
184
186
|
fragments: import_fragmentRegistry.fragmentRegistry,
|
|
185
187
|
possibleTypes: cacheConfig?.possibleTypes,
|
|
186
188
|
...cacheConfig
|
|
@@ -109,7 +109,7 @@ function wrapConsoleMethod(name) {
|
|
|
109
109
|
})(invariant || (invariant = {}));
|
|
110
110
|
|
|
111
111
|
// ../../node_modules/@apollo/client/version.js
|
|
112
|
-
var version = "3.13.
|
|
112
|
+
var version = "3.13.9";
|
|
113
113
|
|
|
114
114
|
// ../../node_modules/@apollo/client/utilities/globals/maybe.js
|
|
115
115
|
function maybe(thunk) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -143,10 +143,10 @@
|
|
|
143
143
|
"test:watch": "vitest watch"
|
|
144
144
|
},
|
|
145
145
|
"dependencies": {
|
|
146
|
-
"@apollo/client": "3.13.
|
|
146
|
+
"@apollo/client": "3.13.9",
|
|
147
147
|
"@babel/runtime-corejs3": "7.27.6",
|
|
148
|
-
"@cedarjs/auth": "0.
|
|
149
|
-
"@cedarjs/server-store": "0.
|
|
148
|
+
"@cedarjs/auth": "0.7.0",
|
|
149
|
+
"@cedarjs/server-store": "0.7.0",
|
|
150
150
|
"@dr.pogodin/react-helmet": "2.0.4",
|
|
151
151
|
"@whatwg-node/fetch": "0.9.21",
|
|
152
152
|
"apollo-upload-client": "18.0.1",
|
|
@@ -160,14 +160,14 @@
|
|
|
160
160
|
"ts-toolbelt": "9.6.0"
|
|
161
161
|
},
|
|
162
162
|
"devDependencies": {
|
|
163
|
-
"@apollo/client-react-streaming": "0.12.
|
|
163
|
+
"@apollo/client-react-streaming": "0.12.3",
|
|
164
164
|
"@arethetypeswrong/cli": "0.18.2",
|
|
165
165
|
"@babel/cli": "7.27.2",
|
|
166
166
|
"@babel/core": "^7.26.10",
|
|
167
167
|
"@babel/plugin-transform-runtime": "7.27.4",
|
|
168
168
|
"@babel/runtime": "7.27.6",
|
|
169
|
-
"@cedarjs/framework-tools": "0.
|
|
170
|
-
"@cedarjs/internal": "0.
|
|
169
|
+
"@cedarjs/framework-tools": "0.7.0",
|
|
170
|
+
"@cedarjs/internal": "0.7.0",
|
|
171
171
|
"@rollup/plugin-babel": "6.0.4",
|
|
172
172
|
"@testing-library/jest-dom": "6.5.0",
|
|
173
173
|
"@testing-library/react": "14.3.1",
|
|
@@ -191,5 +191,5 @@
|
|
|
191
191
|
"publishConfig": {
|
|
192
192
|
"access": "public"
|
|
193
193
|
},
|
|
194
|
-
"gitHead": "
|
|
194
|
+
"gitHead": "9e720ea4b6ca8306d466378104f532f818015531"
|
|
195
195
|
}
|