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

apollo-link

Package Overview
Dependencies
Maintainers
3
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-link - npm Package Compare versions

Comparing version 0.6.1-beta.0 to 0.6.1-beta.1

15

dist/src/bundle.umd.js

@@ -20,10 +20,2 @@ (function (global, factory) {

})();
function validateLink(link) {
if (link instanceof ApolloLink$1 && typeof link.request === 'function') {
return link;
}
else {
throw new LinkError('Link does not extend ApolloLink and implement request', link);
}
}
function validateOperation(operation) {

@@ -112,4 +104,4 @@ var OPERATION_FIELDS = ['query', 'operationName', 'variables', 'context'];

if (right === void 0) { right = ApolloLink.passthrough(); }
var leftLink = validateLink(toLink(left));
var rightLink = validateLink(toLink(right));
var leftLink = toLink(left);
var rightLink = toLink(right);
if (isTerminating(leftLink) && isTerminating(rightLink)) {

@@ -136,3 +128,2 @@ return new FunctionLink(function (operation) {

var _this = this;
validateLink(this);
if (isTerminating(this)) {

@@ -142,3 +133,3 @@ console.warn(new LinkError("You are calling concat on a terminating link, which will have no effect", this));

}
var nextLink = validateLink(toLink(next));
var nextLink = toLink(next);
if (isTerminating(nextLink)) {

@@ -145,0 +136,0 @@ return new FunctionLink(function (operation) {

9

dist/src/link.js

@@ -19,3 +19,3 @@ var __extends = (this && this.__extends) || (function () {

};
import { validateOperation, toLink, isTerminating, LinkError, validateLink, } from './linkUtils';
import { validateOperation, toLink, isTerminating, LinkError, } from './linkUtils';
import gql from 'graphql-tag';

@@ -40,4 +40,4 @@ import Observable from 'zen-observable-ts';

if (right === void 0) { right = ApolloLink.passthrough(); }
var leftLink = validateLink(toLink(left));
var rightLink = validateLink(toLink(right));
var leftLink = toLink(left);
var rightLink = toLink(right);
if (isTerminating(leftLink) && isTerminating(rightLink)) {

@@ -64,3 +64,2 @@ return new FunctionLink(function (operation) {

var _this = this;
validateLink(this);
if (isTerminating(this)) {

@@ -70,3 +69,3 @@ console.warn(new LinkError("You are calling concat on a terminating link, which will have no effect", this));

}
var nextLink = validateLink(toLink(next));
var nextLink = toLink(next);
if (isTerminating(nextLink)) {

@@ -73,0 +72,0 @@ return new FunctionLink(function (operation) {

import { GraphQLRequest, RequestHandler } from './types';
import { ApolloLink } from './link';
import Observable from 'zen-observable-ts';
export declare function validateLink(link: ApolloLink): ApolloLink;
export declare function validateOperation(operation: GraphQLRequest): GraphQLRequest;

@@ -6,0 +5,0 @@ export declare class LinkError extends Error {

@@ -11,11 +11,3 @@ var __extends = (this && this.__extends) || (function () {

})();
import { ApolloLink, FunctionLink } from './link';
export function validateLink(link) {
if (link instanceof ApolloLink && typeof link.request === 'function') {
return link;
}
else {
throw new LinkError('Link does not extend ApolloLink and implement request', link);
}
}
import { FunctionLink } from './link';
export function validateOperation(operation) {

@@ -22,0 +14,0 @@ var OPERATION_FIELDS = ['query', 'operationName', 'variables', 'context'];

{
"name": "apollo-link",
"version": "0.6.1-beta.0",
"version": "0.6.1-beta.1",
"description": "Flexible, lightweight transport layer for GraphQL",

@@ -53,3 +53,3 @@ "author": "Evans Hauser <evanshauser@gmail.com>",

"graphql-tag": "^2.4.2",
"zen-observable-ts": "^0.4.2"
"zen-observable-ts": "^0.4.3-beta.0"
},

@@ -56,0 +56,0 @@ "devDependencies": {

@@ -14,3 +14,2 @@ import {

LinkError,
validateLink,
} from './linkUtils';

@@ -55,4 +54,4 @@

): ApolloLink {
const leftLink = validateLink(toLink(left));
const rightLink = validateLink(toLink(right));
const leftLink = toLink(left);
const rightLink = toLink(right);

@@ -84,4 +83,2 @@ if (isTerminating(leftLink) && isTerminating(rightLink)) {

public concat(next: ApolloLink | RequestHandler): ApolloLink {
validateLink(this);
if (isTerminating(this)) {

@@ -96,3 +93,3 @@ console.warn(

}
const nextLink = validateLink(toLink(next));
const nextLink = toLink(next);

@@ -99,0 +96,0 @@ if (isTerminating(nextLink)) {

@@ -7,13 +7,2 @@ import { GraphQLRequest, RequestHandler } from './types';

export function validateLink(link: ApolloLink): ApolloLink {
if (link instanceof ApolloLink && typeof link.request === 'function') {
return link;
} else {
throw new LinkError(
'Link does not extend ApolloLink and implement request',
link,
);
}
}
export function validateOperation(operation: GraphQLRequest): GraphQLRequest {

@@ -20,0 +9,0 @@ const OPERATION_FIELDS = ['query', 'operationName', 'variables', 'context'];

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