Socket
Socket
Sign inDemoInstall

@subql/apollo-links

Package Overview
Dependencies
Maintainers
2
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@subql/apollo-links - npm Package Compare versions

Comparing version 0.5.9-2 to 0.5.9-3

5

dist/authHttpLink.d.ts

@@ -1,6 +0,7 @@

import { ApolloLink, HttpOptions } from '@apollo/client/core';
import { ApolloLink } from '@apollo/client/core';
import { Options } from './core';
import { Logger } from './utils/logger';
interface BaseAuthOptions {
authUrl: string;
httpOptions: HttpOptions;
httpOptions: Options['httpOptions'];
logger?: Logger;

@@ -7,0 +8,0 @@ fallbackServiceUrl?: string;

11

dist/core/dynamicHttpLink.d.ts
import { ApolloLink, FetchResult, HttpOptions, NextLink, Observable, Operation } from '@apollo/client/core';
import { Logger } from '../utils/logger';
declare type Options = {
httpOptions: HttpOptions;
export declare type Options = {
httpOptions: {
/**
* @remarks
* Please confirm your `fetch` attaches headers `Content-Type` and `Content-Length`.
*/
fetch?: HttpOptions['fetch'];
} & HttpOptions;
logger?: Logger;

@@ -14,2 +20,1 @@ };

}
export {};
"use strict";
// Copyright 2020-2022 SubQuery Pte Ltd authors & contributors
// SPDX-License-Identifier: Apache-2.0
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DynamicHttpLink = void 0;
const core_1 = require("@apollo/client/core");
const cross_fetch_1 = __importDefault(require("cross-fetch"));
class DynamicHttpLink extends core_1.ApolloLink {

@@ -28,3 +32,3 @@ constructor(options) {

createHttpLink(uri) {
return new core_1.HttpLink(Object.assign(Object.assign({}, this.options.httpOptions), { uri }));
return new core_1.HttpLink(Object.assign(Object.assign({}, this.options.httpOptions), { fetch: this.options.httpOptions.fetch ? this.options.httpOptions.fetch : cross_fetch_1.default, uri }));
}

@@ -31,0 +35,0 @@ }

{
"name": "@subql/apollo-links",
"version": "0.5.9-2",
"version": "0.5.9-3",
"description": "SubQuery Network - graphql links",

@@ -16,2 +16,3 @@ "main": "dist/index.js",

"buffer": "^6.0.3",
"cross-fetch": "^4.0.0",
"ethers": "^5.6.8",

@@ -30,3 +31,3 @@ "jwt-decode": "^3.1.2",

},
"stableVersion": "0.5.9-1"
"stableVersion": "0.5.9-2"
}
// Copyright 2020-2022 SubQuery Pte Ltd authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ApolloLink, HttpOptions, from } from '@apollo/client/core';
import { ApolloLink, from } from '@apollo/client/core';
import {
ClusterAuthLink,
DynamicHttpLink,

@@ -12,2 +11,4 @@ FallbackLink,

creatErrorLink,
ClusterAuthLink,
Options,
createRetryLink,

@@ -22,3 +23,3 @@ } from './core';

authUrl: string; // auth service url
httpOptions: HttpOptions; // http options for init `HttpLink`
httpOptions: Options['httpOptions']; // http options for init `HttpLink`
logger?: Logger; // logger for `AuthLink`

@@ -25,0 +26,0 @@ fallbackServiceUrl?: string; // fall back service url for `AuthLink`

@@ -14,5 +14,12 @@ // Copyright 2020-2022 SubQuery Pte Ltd authors & contributors

import { Logger } from '../utils/logger';
import fetch from 'cross-fetch';
type Options = {
httpOptions: HttpOptions; // http options for init `HttpLink`
export type Options = {
httpOptions: {
/**
* @remarks
* Please confirm your `fetch` attaches headers `Content-Type` and `Content-Length`.
*/
fetch?: HttpOptions['fetch'];
} & HttpOptions; // http options for init `HttpLink`
logger?: Logger;

@@ -50,2 +57,3 @@ };

...this.options.httpOptions,
fetch: this.options.httpOptions.fetch ? this.options.httpOptions.fetch : fetch,
uri,

@@ -52,0 +60,0 @@ });

Sorry, the diff of this file is not supported yet

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