Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@8base/apollo-client

Package Overview
Dependencies
Maintainers
5
Versions
223
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@8base/apollo-client - npm Package Compare versions

Comparing version 1.4.0 to 2.0.0

CHANGELOG.md

8

dist/index.d.ts

@@ -0,7 +1,5 @@

import { IAuthState } from '@8base/utils';
import { ApolloClientOptions as OriginalApolloClientOptions, ApolloClient as OriginalApolloClient, InMemoryCache, ApolloLink, Operation } from '@apollo/client';
import { ErrorHandler } from '@apollo/client/link/error';
import gql from 'graphql-tag';
import { ApolloClientOptions as OriginalApolloClientOptions, ApolloClient as OriginalApolloClient } from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { ApolloLink, Operation } from 'apollo-link';
import { ErrorHandler } from 'apollo-link-error';
import { IAuthState } from '@8base/utils';
declare type ApolloClientCommon = {

@@ -8,0 +6,0 @@ uri: string;

@@ -17,13 +17,12 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.InMemoryCache = exports.gql = exports.ApolloClient = void 0;
const apollo_links_1 = require("@8base/apollo-links");
const utils_1 = require("@8base/utils");
const client_1 = require("@apollo/client");
Object.defineProperty(exports, "InMemoryCache", { enumerable: true, get: function () { return client_1.InMemoryCache; } });
const batch_http_1 = require("@apollo/client/link/batch-http");
const error_1 = require("@apollo/client/link/error");
const utilities_1 = require("@apollo/client/utilities");
const graphql_tag_1 = __importDefault(require("graphql-tag"));
exports.gql = graphql_tag_1.default;
const apollo_client_1 = require("apollo-client");
const apollo_cache_inmemory_1 = require("apollo-cache-inmemory");
exports.InMemoryCache = apollo_cache_inmemory_1.InMemoryCache;
const apollo_link_1 = require("apollo-link");
const apollo_link_batch_http_1 = require("apollo-link-batch-http");
const apollo_links_1 = require("@8base/apollo-links");
const apollo_link_error_1 = require("apollo-link-error");
const apollo_utilities_1 = require("apollo-utilities");
const utils_1 = require("@8base/utils");
/**

@@ -45,3 +44,3 @@ * Extended Apollo Client by 8base several links.

*/
class ApolloClient extends apollo_client_1.ApolloClient {
class ApolloClient extends client_1.ApolloClient {
constructor(config) {

@@ -51,10 +50,10 @@ const { uri, getAuthState, getRefreshTokenParameters, onAuthSuccess, onAuthError, onIdTokenExpired, onRequestSuccess, onRequestError, extendLinks, withAuth = true, autoSignUp = false, withSubscriptions = false, authProfileId } = config, rest = __rest(config, ["uri", "getAuthState", "getRefreshTokenParameters", "onAuthSuccess", "onAuthError", "onIdTokenExpired", "onRequestSuccess", "onRequestError", "extendLinks", "withAuth", "autoSignUp", "withSubscriptions", "authProfileId"]);

if (!cache) {
cache = new apollo_cache_inmemory_1.InMemoryCache();
cache = new client_1.InMemoryCache();
}
const batchHttpLink = new apollo_link_batch_http_1.BatchHttpLink({ uri });
const batchHttpLink = new batch_http_1.BatchHttpLink({ uri });
let links = [batchHttpLink];
if (withSubscriptions && getAuthState) {
links = [
apollo_link_1.ApolloLink.split(({ query }) => {
const definition = apollo_utilities_1.getMainDefinition(query);
client_1.ApolloLink.split(({ query }) => {
const definition = utilities_1.getMainDefinition(query);
return definition.kind === 'OperationDefinition' && definition.operation === 'subscription';

@@ -96,3 +95,3 @@ }, new apollo_links_1.SubscriptionLink({

if (typeof onRequestError === 'function') {
links = [apollo_link_error_1.onError(onRequestError), ...links];
links = [error_1.onError(onRequestError), ...links];
}

@@ -102,3 +101,3 @@ if (typeof extendLinks === 'function') {

}
const link = apollo_link_1.ApolloLink.from(links);
const link = client_1.ApolloLink.from(links);
super(Object.assign({ cache, link }, rest));

@@ -105,0 +104,0 @@ }

{
"name": "@8base/apollo-client",
"version": "1.4.0",
"version": "2.0.0",
"repository": "https://github.com/8base/sdk",
"homepage": "https://github.com/8base/sdk/tree/master/packages/apollo-client#readme",
"homepage": "https://github.com/8base/sdk/tree/master/packages-core/apollo-client#readme",
"main": "dist/index.js",
"module": "dist/index.js",
"scripts": {
"build": "../../bin/build-package.sh",
"watch": "../../bin/watch-package.sh",
"build": "../../../bin/build-package.sh",
"watch": "../../../bin/watch-package.sh",
"test": "NPM_ENV=test jest"
},
"peerDependencies": {
"apollo-client": "^2.6.3",
"graphql": "^14.0.0"
"@apollo/client": "^3.3.7",
"graphql": "^15.5.0"
},
"dependencies": {
"@8base/apollo-links": "^1.4.0",
"@8base/utils": "^1.4.0",
"apollo-cache-inmemory": "^1.5.1",
"apollo-link": "1.2.11",
"apollo-link-batch-http": "^1.2.11",
"apollo-link-error": "^1.1.10",
"apollo-utilities": "^1.3.2",
"graphql-tag": "^2.10.0"
"@8base/apollo-links": "^2.0.0",
"@8base/utils": "^2.0.0"
},
"devDependencies": {
"@types/graphql": "^14.2.0",
"@types/jest": "^24.0.13",
"apollo-client": "^2.6.3",
"graphql": "^14.3.1",
"jest": "24.7.1",
"jest-fetch-mock": "^2.1.0",
"prettier": "^1.16.4",
"ts-jest": "^24.0.2",
"typescript": "^3.5.1"
"@apollo/client": "^3.3.7",
"@types/graphql": "^14.5.0",
"@types/jest": "^26.0.20",
"graphql": "^15.5.0",
"jest": "26.6.3",
"jest-fetch-mock": "^3.0.3",
"prettier": "^2.2.1",
"ts-jest": "^26.4.4",
"typescript": "^4.1.3"
},

@@ -41,3 +35,3 @@ "jest": {

"ts-jest": {
"tsConfig": "<rootDir>/tsconfig.json"
"tsconfig": "<rootDir>/tsconfig.json"
}

@@ -44,0 +38,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc