Skip to content

Commit

Permalink
feat: Updated link packages to use Apollo 3 awslabs#561
Browse files Browse the repository at this point in the history
  • Loading branch information
boxcc committed Jul 31, 2020
1 parent 45fd640 commit 4345a1e
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 21 deletions.
4 changes: 2 additions & 2 deletions packages/aws-appsync-auth-link/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@boxcc/aws-appsync-auth-link",
"version": "2.0.4",
"version": "3.0.0",
"main": "lib/index.js",
"license": "Apache-2.0",
"description": "AWS Mobile AppSync Auth Link for JavaScript",
Expand All @@ -19,7 +19,7 @@
"test-watch": "jest --watch"
},
"dependencies": {
"apollo-link": "^1.2.3",
"@apollo/client": "^3.1.1",
"aws-sdk": "^2.518.0",
"debug": "2.6.9"
}
Expand Down
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AUTH_TYPE } from "@boxcc/aws-appsync-auth-link";
import { execute } from "apollo-link";
import { execute } from "@apollo/client";
import gql from 'graphql-tag';
import { AppSyncRealTimeSubscriptionHandshakeLink } from '../../src/realtime-subscription-handshake-link';

Expand Down
11 changes: 5 additions & 6 deletions packages/aws-appsync-subscription-link/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@boxcc/aws-appsync-subscription-link",
"version": "2.2.0",
"version": "3.0.0",
"main": "lib/index.js",
"license": "Apache-2.0",
"description": "AWS Mobile AppSync SDK for JavaScript",
Expand All @@ -20,17 +20,16 @@
},
"dependencies": {
"@boxcc/aws-appsync-auth-link": "^2.0.4",
"apollo-link": "^1.2.3",
"apollo-link-context": "^1.0.9",
"apollo-link-http": "^1.3.1",
"apollo-link-retry": "^2.2.5",
"@apollo/client": "^3.1.1",
"@apollo/link-context": "^2.0.0-beta.3",
"@apollo/link-retry": "^2.0.0-beta.3",
"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"
}
}
3 changes: 1 addition & 2 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
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 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

0 comments on commit 4345a1e

Please sign in to comment.