naystack 1.2.19 → 1.2.20
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.
|
@@ -41,16 +41,14 @@ var import_client = require("@apollo/client");
|
|
|
41
41
|
var import_client_integration_nextjs = require("@apollo/client-integration-nextjs");
|
|
42
42
|
var import_client2 = require("naystack/auth/email/client");
|
|
43
43
|
var import_react = __toESM(require("react"));
|
|
44
|
-
var getApolloWrapper = ({
|
|
45
|
-
|
|
46
|
-
cacheConfig,
|
|
47
|
-
authEndpoint
|
|
44
|
+
var getApolloWrapper = (endpoint, {
|
|
45
|
+
cacheConfig
|
|
48
46
|
}) => {
|
|
49
47
|
function makeClient() {
|
|
50
48
|
return new import_client_integration_nextjs.ApolloClient({
|
|
51
49
|
cache: new import_client_integration_nextjs.InMemoryCache(cacheConfig),
|
|
52
50
|
link: new import_client.HttpLink({
|
|
53
|
-
uri:
|
|
51
|
+
uri: endpoint
|
|
54
52
|
})
|
|
55
53
|
});
|
|
56
54
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import * as _apollo_client from '@apollo/client';
|
|
2
|
-
import { OperationVariables, MutationHookOptions } from '@apollo/client';
|
|
3
|
-
import { InMemoryCacheConfig } from '@apollo/client/cache';
|
|
2
|
+
import { InMemoryCacheConfig, OperationVariables, MutationHookOptions } from '@apollo/client';
|
|
4
3
|
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
4
|
import react__default, { PropsWithChildren } from 'react';
|
|
6
5
|
|
|
7
|
-
declare const getApolloWrapper: (
|
|
8
|
-
graphqlUri: string;
|
|
9
|
-
authEndpoint: string;
|
|
6
|
+
declare const getApolloWrapper: (endpoint: string, { cacheConfig, }: {
|
|
10
7
|
cacheConfig?: InMemoryCacheConfig;
|
|
11
8
|
}) => ({ children }: PropsWithChildren) => react__default.JSX.Element;
|
|
12
9
|
declare const tokenContext: (token?: string | null) => {
|
package/dist/graphql/client.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import * as _apollo_client from '@apollo/client';
|
|
2
|
-
import { OperationVariables, MutationHookOptions } from '@apollo/client';
|
|
3
|
-
import { InMemoryCacheConfig } from '@apollo/client/cache';
|
|
2
|
+
import { InMemoryCacheConfig, OperationVariables, MutationHookOptions } from '@apollo/client';
|
|
4
3
|
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
4
|
import react__default, { PropsWithChildren } from 'react';
|
|
6
5
|
|
|
7
|
-
declare const getApolloWrapper: (
|
|
8
|
-
graphqlUri: string;
|
|
9
|
-
authEndpoint: string;
|
|
6
|
+
declare const getApolloWrapper: (endpoint: string, { cacheConfig, }: {
|
|
10
7
|
cacheConfig?: InMemoryCacheConfig;
|
|
11
8
|
}) => ({ children }: PropsWithChildren) => react__default.JSX.Element;
|
|
12
9
|
declare const tokenContext: (token?: string | null) => {
|
|
@@ -17,16 +17,14 @@ import React, {
|
|
|
17
17
|
useEffect,
|
|
18
18
|
useState
|
|
19
19
|
} from "react";
|
|
20
|
-
var getApolloWrapper = ({
|
|
21
|
-
|
|
22
|
-
cacheConfig,
|
|
23
|
-
authEndpoint
|
|
20
|
+
var getApolloWrapper = (endpoint, {
|
|
21
|
+
cacheConfig
|
|
24
22
|
}) => {
|
|
25
23
|
function makeClient() {
|
|
26
24
|
return new ApolloClient({
|
|
27
25
|
cache: new InMemoryCache(cacheConfig),
|
|
28
26
|
link: new HttpLink({
|
|
29
|
-
uri:
|
|
27
|
+
uri: endpoint
|
|
30
28
|
})
|
|
31
29
|
});
|
|
32
30
|
}
|
package/dist/graphql/init.d.mts
CHANGED
|
@@ -6,7 +6,7 @@ declare function initGraphQLServer({ authChecker, resolvers, plugins, getContext
|
|
|
6
6
|
authChecker?: AuthChecker<any>;
|
|
7
7
|
resolvers: NonEmptyArray<Function>;
|
|
8
8
|
plugins?: ApolloServerPlugin[];
|
|
9
|
-
getContext?: (req: NextRequest) => Promise<any
|
|
9
|
+
getContext?: (req: NextRequest) => Promise<any> | any;
|
|
10
10
|
}): Promise<{
|
|
11
11
|
GET: (request: NextRequest) => Promise<Response>;
|
|
12
12
|
POST: (request: NextRequest) => Promise<Response>;
|
package/dist/graphql/init.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare function initGraphQLServer({ authChecker, resolvers, plugins, getContext
|
|
|
6
6
|
authChecker?: AuthChecker<any>;
|
|
7
7
|
resolvers: NonEmptyArray<Function>;
|
|
8
8
|
plugins?: ApolloServerPlugin[];
|
|
9
|
-
getContext?: (req: NextRequest) => Promise<any
|
|
9
|
+
getContext?: (req: NextRequest) => Promise<any> | any;
|
|
10
10
|
}): Promise<{
|
|
11
11
|
GET: (request: NextRequest) => Promise<Response>;
|
|
12
12
|
POST: (request: NextRequest) => Promise<Response>;
|