apollo-cache
Advanced tools
Comparing version 1.2.0-verify.4 to 1.2.0
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('apollo-utilities')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'apollo-utilities'], factory) : | ||
(factory((global.apollo = global.apollo || {}, global.apollo.cache = global.apollo.cache || {}, global.apollo.cache.core = {}),global.apollo.utilities)); | ||
}(this, (function (exports,apolloUtilities) { 'use strict'; | ||
(global = global || self, factory(global['apolloCache.core'] = {}, global.apollo.utilities)); | ||
}(this, function (exports, apolloUtilities) { 'use strict'; | ||
@@ -58,2 +58,3 @@ function queryFromPojo(obj) { | ||
Object.keys(obj).forEach(function (key) { | ||
var nestedSelSet = selectionSetFromObj(obj[key]); | ||
var field = { | ||
@@ -65,7 +66,4 @@ kind: 'Field', | ||
}, | ||
selectionSet: nestedSelSet || undefined, | ||
}; | ||
var nestedSelSet = selectionSetFromObj(obj[key]); | ||
if (nestedSelSet) { | ||
field.selectionSet = nestedSelSet; | ||
} | ||
selections.push(field); | ||
@@ -178,2 +176,3 @@ }); | ||
(function (Cache) { | ||
@@ -186,3 +185,3 @@ })(exports.Cache || (exports.Cache = {})); | ||
}))); | ||
})); | ||
//# sourceMappingURL=bundle.umd.js.map |
@@ -0,0 +0,0 @@ import { DocumentNode } from 'graphql'; |
@@ -1,3 +0,5 @@ | ||
import { getFragmentQueryDocument } from 'apollo-utilities'; | ||
import { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var apollo_utilities_1 = require("apollo-utilities"); | ||
var utils_1 = require("./utils"); | ||
var ApolloCache = (function () { | ||
@@ -23,3 +25,3 @@ function ApolloCache() { | ||
return this.read({ | ||
query: getFragmentQueryDocument(options.fragment, options.fragmentName), | ||
query: apollo_utilities_1.getFragmentQueryDocument(options.fragment, options.fragmentName), | ||
variables: options.variables, | ||
@@ -43,3 +45,3 @@ rootId: options.id, | ||
variables: options.variables, | ||
query: getFragmentQueryDocument(options.fragment, options.fragmentName), | ||
query: apollo_utilities_1.getFragmentQueryDocument(options.fragment, options.fragmentName), | ||
}); | ||
@@ -55,3 +57,3 @@ }; | ||
optimistic: false, | ||
query: justTypenameQuery, | ||
query: utils_1.justTypenameQuery, | ||
}); | ||
@@ -65,3 +67,3 @@ } | ||
id: id, | ||
fragment: fragmentFromPojo(dataToWrite, __typename), | ||
fragment: utils_1.fragmentFromPojo(dataToWrite, __typename), | ||
data: dataToWrite, | ||
@@ -71,3 +73,3 @@ }); | ||
else { | ||
this.writeQuery({ query: queryFromPojo(data), data: data }); | ||
this.writeQuery({ query: utils_1.queryFromPojo(data), data: data }); | ||
} | ||
@@ -77,3 +79,3 @@ }; | ||
}()); | ||
export { ApolloCache }; | ||
exports.ApolloCache = ApolloCache; | ||
//# sourceMappingURL=cache.js.map |
export * from './cache'; | ||
export * from './types'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,3 +0,6 @@ | ||
export * from './cache'; | ||
export * from './types'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./cache"), exports); | ||
tslib_1.__exportStar(require("./types"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ import { DataProxy } from './DataProxy'; |
@@ -1,4 +0,6 @@ | ||
export var Cache; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Cache; | ||
(function (Cache) { | ||
})(Cache || (Cache = {})); | ||
})(Cache = exports.Cache || (exports.Cache = {})); | ||
//# sourceMappingURL=Cache.js.map |
@@ -0,0 +0,0 @@ import { DocumentNode } from 'graphql'; |
@@ -0,1 +1,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=DataProxy.js.map |
export * from './DataProxy'; | ||
export * from './Cache'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,5 @@ | ||
export * from './Cache'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./Cache"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ import { DocumentNode } from 'graphql'; |
@@ -1,2 +0,4 @@ | ||
export function queryFromPojo(obj) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function queryFromPojo(obj) { | ||
var op = { | ||
@@ -17,3 +19,4 @@ kind: 'OperationDefinition', | ||
} | ||
export function fragmentFromPojo(obj, typename) { | ||
exports.queryFromPojo = queryFromPojo; | ||
function fragmentFromPojo(obj, typename) { | ||
var frag = { | ||
@@ -40,2 +43,3 @@ kind: 'FragmentDefinition', | ||
} | ||
exports.fragmentFromPojo = fragmentFromPojo; | ||
function selectionSetFromObj(obj) { | ||
@@ -54,2 +58,3 @@ if (typeof obj === 'number' || | ||
Object.keys(obj).forEach(function (key) { | ||
var nestedSelSet = selectionSetFromObj(obj[key]); | ||
var field = { | ||
@@ -61,7 +66,4 @@ kind: 'Field', | ||
}, | ||
selectionSet: nestedSelSet || undefined, | ||
}; | ||
var nestedSelSet = selectionSetFromObj(obj[key]); | ||
if (nestedSelSet) { | ||
field.selectionSet = nestedSelSet; | ||
} | ||
selections.push(field); | ||
@@ -75,3 +77,3 @@ }); | ||
} | ||
export var justTypenameQuery = { | ||
exports.justTypenameQuery = { | ||
kind: 'Document', | ||
@@ -78,0 +80,0 @@ definitions: [ |
{ | ||
"name": "apollo-cache", | ||
"version": "1.2.0-verify.4", | ||
"version": "1.2.0", | ||
"description": "Core abstract of Caching layer for Apollo Client", | ||
@@ -13,5 +13,4 @@ "author": "James Baxley <james@meteor.com>", | ||
"license": "MIT", | ||
"main": "./lib/bundle.umd.js", | ||
"module": "./lib/index.js", | ||
"jsnext:main": "./lib/index.js", | ||
"main": "./lib/bundle.cjs.js", | ||
"module": "./lib/bundle.esm.js", | ||
"typings": "./lib/index.d.ts", | ||
@@ -30,31 +29,17 @@ "sideEffects": false, | ||
"coverage": "jest --coverage", | ||
"test": "jest", | ||
"test": "tsc -p tsconfig.json --noEmit && jest", | ||
"lint": "tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts && tslint -c \"../../config/tslint.json\" -p tsconfig.json tests/*.ts", | ||
"prebuild": "npm run clean", | ||
"build": "tsc -p .", | ||
"build": "tsc -b .", | ||
"postbuild": "npm run bundle", | ||
"bundle": "../../node_modules/rollup/bin/rollup -c rollup.config.js", | ||
"watch": "tsc -w -p .", | ||
"clean": "rm -rf coverage/* && rm -rf lib/*", | ||
"prepublishOnly": "npm run clean && npm run build", | ||
"minify": "../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js", | ||
"filesize": "npm run minify" | ||
"watch": "../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"", | ||
"clean": "rm -rf coverage/* lib/*", | ||
"prepublishOnly": "npm run clean && npm run build" | ||
}, | ||
"dependencies": { | ||
"apollo-utilities": "^1.1.0-verify.4" | ||
"apollo-utilities": "^1.2.0", | ||
"tslib": "^1.9.3" | ||
}, | ||
"jest": { | ||
"transform": { | ||
".(ts|tsx)": "ts-jest" | ||
}, | ||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"json" | ||
], | ||
"testURL": "http://localhost" | ||
}, | ||
"gitHead": "aa5d083bdc328149e506b275c07d978b3b7fefd9" | ||
"gitHead": "bc740e09d1b40d2186933e4793d8d66ae8e627ef" | ||
} |
@@ -0,0 +0,0 @@ import gql from 'graphql-tag'; |
@@ -125,3 +125,3 @@ import { DocumentNode } from 'graphql'; | ||
try { | ||
typenameResult = this.read({ | ||
typenameResult = this.read<any>({ | ||
rootId: id, | ||
@@ -128,0 +128,0 @@ optimistic: false, |
export * from './cache'; | ||
export * from './types'; |
@@ -0,0 +0,0 @@ import { DataProxy } from './DataProxy'; |
@@ -0,0 +0,0 @@ import { DocumentNode } from 'graphql'; // eslint-disable-line import/no-extraneous-dependencies, import/no-unresolved |
export * from './DataProxy'; | ||
export * from './Cache'; |
@@ -74,2 +74,4 @@ import { | ||
Object.keys(obj).forEach(key => { | ||
const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]); | ||
const field: FieldNode = { | ||
@@ -81,11 +83,5 @@ kind: 'Field', | ||
}, | ||
selectionSet: nestedSelSet || undefined, | ||
}; | ||
// Recurse | ||
const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]); | ||
if (nestedSelSet) { | ||
field.selectionSet = nestedSelSet; | ||
} | ||
selections.push(field); | ||
@@ -92,0 +88,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
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
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
93174
44
1402
2
+ Addedtslib@^1.9.3
Updatedapollo-utilities@^1.2.0