Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ lib
lerna-debug.log
yarn.lock
.npmrc
yarn.lock
2 changes: 1 addition & 1 deletion packages/aws-appsync-auth-link/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log

All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.1
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

<a name="2.0.2"></a>
Expand Down
9 changes: 5 additions & 4 deletions packages/aws-appsync-auth-link/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-appsync-auth-link",
"version": "2.0.2",
"name": "@boxcc/aws-appsync-auth-link",
"version": "3.0.2",
"main": "lib/index.js",
"license": "Apache-2.0",
"description": "AWS Mobile AppSync Auth Link for JavaScript",
Expand All @@ -19,8 +19,9 @@
"test-watch": "jest --watch"
},
"dependencies": {
"apollo-link": "^1.2.3",
"@apollo/client": "^3.1.1",
"aws-sdk": "^2.518.0",
"debug": "2.6.9"
}
},
"gitHead": "4307763211df51882f599527e41e9aa5e07ec8c3"
}
4 changes: 1 addition & 3 deletions packages/aws-appsync-auth-link/src/auth-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
* Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import { Observable, Operation, NextLink } from 'apollo-link';
import { ApolloLink } from 'apollo-link';
import { ExecutionResult } from 'graphql';
import { ApolloLink, Observable } from '@apollo/client';
import { print } from 'graphql/language/printer';

import { Signer } from './signer';
Expand Down
1 change: 0 additions & 1 deletion packages/aws-appsync-auth-link/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AuthLink, AuthOptions, AUTH_TYPE, USER_AGENT_HEADER, USER_AGENT } from './auth-link';


export const createAuthLink = ({ url, region, auth }: { url: string, region: string, auth: AuthOptions }) => new AuthLink({ url, region, auth });

export { AuthLink, AuthOptions, AUTH_TYPE, USER_AGENT_HEADER, USER_AGENT };
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-appsync-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log

All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.1
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

<a name="3.0.4"></a>
Expand Down
12 changes: 7 additions & 5 deletions packages/aws-appsync-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-appsync-react",
"version": "4.0.0",
"name": "@boxcc/aws-appsync-react",
"version": "4.0.2",
"main": "lib/index.js",
"license": "Apache-2.0",
"description": "AWS Mobile AppSync SDK for JavaScript - React and React Native components",
Expand All @@ -21,20 +21,22 @@
"prop-types": "^15.6.0"
},
"peerDependencies": {
"aws-appsync": "3.x.x",
"@boxcc/aws-appsync": "4.x.x",
"@react-native-community/netinfo": "5.x.x",
"react": "0.14.x || 15.* || ^15.0.0 || ^16.0.0",
"react-apollo": "2.x"
},
"devDependencies": {
"@boxcc/aws-appsync": "^4.0.2",
"@react-native-community/netinfo": "^5.0.0",
"@types/react": "^16.0.25",
"aws-appsync": "^4.0.0",
"react": "^16.1.1",
"react-apollo": "^2.1.9",
"react-native": "^0.50.3",
"typescript": "^3.0.1"
},
"react-native": {
"./lib/rehydrated": "./lib/rehydrated-rn"
}
},
"gitHead": "4307763211df51882f599527e41e9aa5e07ec8c3"
}
2 changes: 1 addition & 1 deletion packages/aws-appsync-react/src/offline-helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { resultKeyNameFromField } from 'apollo-utilities';
import { DocumentNode, OperationDefinitionNode, FieldNode } from 'graphql';
import { graphql, OptionProps, MutationOpts } from 'react-apollo';

import { buildMutation, CacheOperationTypes, CacheUpdatesOptions } from 'aws-appsync';
import { buildMutation, CacheOperationTypes, CacheUpdatesOptions } from '@boxcc/aws-appsync';

export const graphqlMutation = (
mutation: DocumentNode,
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-appsync-react/src/rehydrated-rn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { View, Text, StyleSheet, ViewPropTypes } from "react-native";
import NetInfo from '@react-native-community/netinfo';
import * as PropTypes from 'prop-types';

import AWSAppSyncClient from 'aws-appsync';
import AWSAppSyncClient from '@boxcc/aws-appsync';
import { RehydratedState } from './index'

export interface RehydrateProps {
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-appsync-react/src/rehydrated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import * as React from 'react';
import * as PropTypes from 'prop-types';

import AWSAppSyncClient from 'aws-appsync';
import AWSAppSyncClient from '@boxcc/aws-appsync';
import { RehydratedState } from './index';

export interface RehydrateProps {
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-appsync-subscription-link/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log

All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.1
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

<a name="2.2.0"></a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AUTH_TYPE } from "aws-appsync-auth-link";
import { execute } from "apollo-link";
import { AUTH_TYPE } from "@boxcc/aws-appsync-auth-link";
import { execute } from "@apollo/client";
import gql from 'graphql-tag';
import { AppSyncRealTimeSubscriptionHandshakeLink } from '../../src/realtime-subscription-handshake-link';

Expand Down
18 changes: 9 additions & 9 deletions packages/aws-appsync-subscription-link/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-appsync-subscription-link",
"version": "2.2.0",
"name": "@boxcc/aws-appsync-subscription-link",
"version": "3.0.2",
"main": "lib/index.js",
"license": "Apache-2.0",
"description": "AWS Mobile AppSync SDK for JavaScript",
Expand All @@ -19,18 +19,18 @@
"test-watch": "jest --watch"
},
"dependencies": {
"apollo-link": "^1.2.3",
"apollo-link-context": "^1.0.9",
"apollo-link-http": "^1.3.1",
"apollo-link-retry": "^2.2.5",
"aws-appsync-auth-link": "^2.0.2",
"@apollo/client": "^3.1.1",
"@apollo/link-context": "^2.0.0-beta.3",
"@apollo/link-retry": "^2.0.0-beta.3",
"@boxcc/aws-appsync-auth-link": "^3.0.2",
"debug": "2.6.9",
"url": "^0.11.0"
},
"devDependencies": {
"@redux-offline/redux-offline": "2.5.2-native.0"
},
"peerDependencies": {
"apollo-client": "2.x"
}
"@apollo/client": "3.x"
},
"gitHead": "4307763211df51882f599527e41e9aa5e07ec8c3"
}
13 changes: 6 additions & 7 deletions packages/aws-appsync-subscription-link/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import {
SubscriptionHandshakeLink,
CONTROL_EVENTS_KEY
} from "./subscription-handshake-link";
import { ApolloLink, Observable } from "apollo-link";
import { createHttpLink } from "apollo-link-http";
import { ApolloLink, Observable, createHttpLink } from "@apollo/client";
import { getMainDefinition } from "apollo-utilities";
import { NonTerminatingLink } from "./non-terminating-link";
import { OperationDefinitionNode } from "graphql";
Expand Down Expand Up @@ -31,7 +30,7 @@ function createSubscriptionHandshakeLink(
resultsFetcherLink =
theResultsFetcherLink || createHttpLink({ uri: infoOrUrl });
subscriptionLinks = ApolloLink.from([
new NonTerminatingLink("controlMessages", {
(new NonTerminatingLink("controlMessages", {
link: new ApolloLink(
(operation, _forward) =>
new Observable<any>(observer => {
Expand All @@ -48,14 +47,14 @@ function createSubscriptionHandshakeLink(
return () => {};
})
)
}),
new NonTerminatingLink("subsInfo", { link: resultsFetcherLink }),
new SubscriptionHandshakeLink("subsInfo")
}) as unknown) as ApolloLink,
(new NonTerminatingLink("subsInfo", { link: resultsFetcherLink }) as unknown) as ApolloLink,
(new SubscriptionHandshakeLink("subsInfo") as unknown) as ApolloLink
]);
} else {
const { url } = infoOrUrl;
resultsFetcherLink = theResultsFetcherLink || createHttpLink({ uri: url });
subscriptionLinks = new AppSyncRealTimeSubscriptionHandshakeLink(infoOrUrl);
subscriptionLinks = new AppSyncRealTimeSubscriptionHandshakeLink(infoOrUrl) as unknown as ApolloLink;
}

return ApolloLink.split(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import { createHttpLink, FetchOptions } from 'apollo-link-http';
import { createHttpLink, HttpOptions } from '@apollo/client';
import { NonTerminatingLink } from './non-terminating-link';

export class NonTerminatingHttpLink extends NonTerminatingLink {
constructor(contextKey: string, options: FetchOptions) {
constructor(contextKey: string, options: HttpOptions) {
const link = createHttpLink(options);

super(contextKey, { link });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import { ApolloLink, NextLink } from 'apollo-link';
import { setContext } from 'apollo-link-context';
import { ApolloLink, NextLink } from '@apollo/client';
import { setContext } from '@apollo/link-context';

export class NonTerminatingLink extends ApolloLink {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import { ApolloLink, Observable, Operation, FetchResult } from "apollo-link";
import { ApolloLink, Observable, Operation, FetchResult } from "@apollo/client";

import { rootLogger } from "./utils";

Expand All @@ -12,7 +12,7 @@ import {
AUTH_TYPE,
USER_AGENT_HEADER,
USER_AGENT
} from "aws-appsync-auth-link";
} from "@boxcc/aws-appsync-auth-link";
import { GraphQLError, print } from "graphql";
import * as url from "url";
import { v4 as uuid } from "uuid";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import { ApolloLink, Observable, Operation, FetchResult } from "apollo-link";
import { ApolloLink, Observable, Operation, FetchResult, ApolloError } from "@apollo/client";

import { rootLogger } from "./utils";
import * as Paho from './vendor/paho-mqtt';
import { ApolloError } from "apollo-client";
import { FieldNode } from "graphql";
import { getMainDefinition } from "apollo-utilities";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AuthOptions } from "aws-appsync-auth-link";
import { AuthOptions } from "@boxcc/aws-appsync-auth-link";

//#region Subscription link enums

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-appsync/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log

All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.1
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

<a name="3.0.4"></a>
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-appsync/__tests__/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ beforeEach(() => {
const { AWSAppSyncClient } = require('../src/client');
({ isOptimistic } = require("../src/link/offline-link"));
({ createHttpLink } = require("apollo-link-http"));
({ Signer } = require("aws-appsync-auth-link"));
({ Signer } = require("@boxcc/aws-appsync-auth-link"));

factory = (opts) => {
return new AWSAppSyncClient(opts);
Expand Down
11 changes: 6 additions & 5 deletions packages/aws-appsync/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-appsync",
"version": "4.0.0",
"name": "@boxcc/aws-appsync",
"version": "4.0.2",
"main": "lib/index.js",
"license": "Apache-2.0",
"description": "AWS Mobile AppSync SDK for JavaScript",
Expand All @@ -19,15 +19,15 @@
"test-watch": "jest --watch"
},
"dependencies": {
"@boxcc/aws-appsync-auth-link": "^3.0.2",
"@boxcc/aws-appsync-subscription-link": "^3.0.2",
"@redux-offline/redux-offline": "2.5.2-native.3",
"apollo-cache-inmemory": "1.3.12",
"apollo-client": "2.4.6",
"apollo-link": "1.2.3",
"apollo-link-context": "1.0.9",
"apollo-link-http": "1.3.1",
"apollo-link-retry": "2.2.5",
"aws-appsync-auth-link": "^2.0.2",
"aws-appsync-subscription-link": "^2.2.0",
"aws-sdk": "2.518.0",
"debug": "2.6.9",
"graphql": "0.13.0",
Expand All @@ -40,5 +40,6 @@
"peerDependencies": {
"@react-native-community/async-storage": "^1.11.0",
"@react-native-community/netinfo": "^5.0.0"
}
},
"gitHead": "4307763211df51882f599527e41e9aa5e07ec8c3"
}
4 changes: 2 additions & 2 deletions packages/aws-appsync/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
} from './link';
import { createStore, StoreOptions, DEFAULT_KEY_PREFIX } from './store';
import { ApolloCache } from 'apollo-cache';
import { AuthOptions, AuthLink, AUTH_TYPE } from 'aws-appsync-auth-link';
import { createSubscriptionHandshakeLink } from 'aws-appsync-subscription-link';
import { AuthOptions, AuthLink, AUTH_TYPE } from '@boxcc/aws-appsync-auth-link';
import { createSubscriptionHandshakeLink } from '@boxcc/aws-appsync-subscription-link';
import { Credentials, CredentialsOptions } from 'aws-sdk/lib/credentials';
import { OperationDefinitionNode, DocumentNode } from 'graphql';
import { passthroughLink } from './utils';
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-appsync/src/deltaSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { SKIP_RETRY_KEY } from "./link/retry-link";
import { DocumentNode, print, OperationDefinitionNode, FieldNode, ExecutionResult } from "graphql";
import { getOpTypeFromOperationName, CacheOperationTypes, getUpdater, QueryWithVariables } from "./helpers/offline";
import { boundSaveSnapshot, replaceUsingMap, EnqueuedMutationEffect, offlineEffectConfig as mutationsConfig } from "./link/offline-link";
import { CONTROL_EVENTS_KEY } from "aws-appsync-subscription-link";
import { CONTROL_EVENTS_KEY } from "@boxcc/aws-appsync-subscription-link";

const logger = rootLogger.extend('deltasync');

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-appsync/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
import AWSAppSyncClient from "./client";
export * from "./client";
export { Signer } from 'aws-appsync-auth-link';
export { Signer } from '@boxcc/aws-appsync-auth-link';
export * from './helpers/offline';

export default AWSAppSyncClient;
2 changes: 1 addition & 1 deletion packages/aws-appsync/src/link/offline-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ const idsMapReducer = (state = {}, action, dataIdFromObject) => {

return {
...state,
...entries,
...entries as object,
};
case actions.COMMIT:
const { remainingMutations } = action;
Expand Down