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
- graphqlUri,
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: graphqlUri
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: ({ graphqlUri, cacheConfig, authEndpoint, }: {
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) => {
@@ -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: ({ graphqlUri, cacheConfig, authEndpoint, }: {
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
- graphqlUri,
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: graphqlUri
27
+ uri: endpoint
30
28
  })
31
29
  });
32
30
  }
@@ -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>;
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naystack",
3
- "version": "1.2.19",
3
+ "version": "1.2.20",
4
4
  "description": "A stack built with Next + GraphQL + S3 + Auth",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",