{"_id":"graphql-anywhere","_rev":"159-9d0fda6f8fa6228bafb5e1c2987a7215","name":"graphql-anywhere","description":"Run GraphQL queries with no schema and just one resolver","dist-tags":{"latest":"4.2.8","next":"4.2.8","alpha":"4.2.0-alpha.9","beta":"4.2.2-rc.3"},"versions":{"0.1.0":{"name":"graphql-anywhere","version":"0.1.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"6cc268e4cc6efa50965734b017cff0af5c7617b4","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.0","_shasum":"8abb89fc1ec5c9e4432fd6b8352129b8cb5a8983","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"8abb89fc1ec5c9e4432fd6b8352129b8cb5a8983","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.0.tgz","integrity":"sha512-cpsLKnJqREVrs7yav5/dayhjSisSRszRzbJuIrTaJyqLnVMvIa7ZYnayIAabPBzjlIOcyuoA36oONt8n8q47/A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBLNNXBjB8c2rlKDkRBfc/+s0z846sJZbp6UBH/aNCw+AiEAyfHhmrjo0GwiEGPpXx4Fc45npesFEgTKJSHDPAbskT4="}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.0.tgz_1472111026440_0.09481205209158361"},"directories":{}},"0.1.1":{"name":"graphql-anywhere","version":"0.1.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"cf659bc668a89141d6e9c27ed07ced4568218e74","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.1","_shasum":"8019dfdb68bdb9f290f40fe03577b8cda28479b6","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"8019dfdb68bdb9f290f40fe03577b8cda28479b6","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.1.tgz","integrity":"sha512-Jic2pYCyC9mH2nXs/UdR/TsHPU95tivvfFIP3lg8ETu6Jc9ffjNPIBtPLf9mxjhZHCYdESs2vSlsxTzkRoDtgA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCU7H0tj9cwVehMVEi3C0E0xiMZcBtxNJMGLmy5DvIxvgIhAMX8JNU9zPiggZ8T/q+3/g+voyL1kmg3uDtt65HaLUW0"}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.1.tgz_1472112209817_0.6429980853572488"},"directories":{}},"0.1.2":{"name":"graphql-anywhere","version":"0.1.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"72253dee253c96609397e42c36d530c7216db5a0","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.2","_shasum":"7dd7e2ba33c1cf425f24fc31eb4c33b7e1b6fe21","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"7dd7e2ba33c1cf425f24fc31eb4c33b7e1b6fe21","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.2.tgz","integrity":"sha512-oo6xz6KnxQWd5O9wO6BBaxhg2h53Vok2MuTdZcNg+CwKUXSJC8wdY/dI+nlJRF0WpPVUIY9M8SEU9NwrFbFfkw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB3ntwmy103thQh9kRTK3gX+6glinE5a3oa1hBoORl9iAiEAmBFytOZ7cNftPv6Mmw5cIODqQZQYTOa+c5L3Uc2/42U="}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.2.tgz_1472112387367_0.7704967567697167"},"directories":{}},"0.1.3":{"name":"graphql-anywhere","version":"0.1.3","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"2bafa63b8e772a9fedf590446c2ff1d53c04db49","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.3","_shasum":"3df7cccab6677b470153b2f7cf2a5059195554ad","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"3df7cccab6677b470153b2f7cf2a5059195554ad","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.3.tgz","integrity":"sha512-E8sKukpIASk3E4xBaaEpbNROPC/5qfZN5CqGiZ++D9IpM1TXAIdci1lrTsCvAwLCbNkBAsEbi3smgIGL1BBD4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxxgmtr7wXFqSVP5rMCb+Rr7dhlt4CfjaAKMJlG0emcQIhAMMe6+UwlpSYWOZ++gqndCSxz54tBFI8AQaBJcLF7jsZ"}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.3.tgz_1472113009469_0.8876001425087452"},"directories":{}},"0.1.4":{"name":"graphql-anywhere","version":"0.1.4","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"cbe573ef494d6e967daa0fb76d69088dd095c270","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.4","_shasum":"e7da4c4190f42869bef5eccaeb43c1ea256b360d","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"e7da4c4190f42869bef5eccaeb43c1ea256b360d","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.4.tgz","integrity":"sha512-2yF2feAFVo27onZlGa0CsA7Xf9XL3nkH3VRBBmMSZ0TOkHY2KWmWrNb6e3LFYD6d3OKO4Wyiq8CPVtcOjS0low==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGa5WI1IT5F6r7tm+PB+p8Qtp0/btkoBYFEtNwnTtXj6AiEA5F3/iJwVW28ARyXze05dFuTr9qIjgQXgYh8p3TQg7Vw="}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.4.tgz_1472255736745_0.1057597913313657"},"directories":{}},"0.1.5":{"name":"graphql-anywhere","version":"0.1.5","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"c66e392ad9f1f85a6a5039c156d6f39c629270ea","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.5","_shasum":"9f4833f4d45660293e605ef27b501bf3fdd68cd0","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"9f4833f4d45660293e605ef27b501bf3fdd68cd0","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.5.tgz","integrity":"sha512-Z2amdlo707ZQHNk+e9mG1vRajrbyFfSU0lsIwy54cJ9zWoVlVk7H0q8K1hU6Ui+N9tqQPM/RgkytXAj2agXsEw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUAvvr9C/yoH53x9cBNtS0Jkg3V3pr7in4CBjAgAB2ywIgPUfXe636u//tAmTTjDHrjOy9WMN70ZCJ7hR/uaAfOIw="}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.5.tgz_1472790891812_0.35781916230916977"},"directories":{}},"0.1.6":{"name":"graphql-anywhere","version":"0.1.6","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.pick":"^4.2.0","react":"^15.3.1","react-dom":"^15.3.1"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"fa3a1b7cfe138888551bc098d23ba93d65930c16","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.6","_shasum":"24bba6084b5851027478c5844e97cb0ef23151c8","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"24bba6084b5851027478c5844e97cb0ef23151c8","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.6.tgz","integrity":"sha512-Xbeq55jXSNA27vDeoLhMJLZFyN7QHOgTHUccIykCzsEOmCa8HLe5/RrHEtO0MTORocNk0cfYqswgvWK9W/oy8g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFXYwhSS455EHr02vVJNz+huogYpoM/38Jp6rbVKE8qRAiEAtbBgTIYNxwtsDv3t9hAioD3X+Asv4YP+ANyYKC114tM="}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.6.tgz_1472880851266_0.6039463337510824"},"directories":{}},"0.1.7":{"name":"graphql-anywhere","version":"0.1.7","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"46a2c1dbb15af3ae94b30bd5018af092c9e57ee9","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.7","_shasum":"48a4d37b694def2f007c6047ca382c98127175c9","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"48a4d37b694def2f007c6047ca382c98127175c9","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.7.tgz","integrity":"sha512-pMA8ArngMYUDbXHR8Tng9gSd6vKh2yky9hKK6guVp8T1FGAHlSTG+UG4dkTh/5mAv9DAnNdD9kXB/UqDr0xK1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHi2T2b6OgePGg1eepHMuleo3Snqb3EVHMt6lzwr46ePAiEAuXUArwro1VYoXRhvyzIcwbDeoKm2KoqQ7ClxdtsBz0Y="}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.7.tgz_1473789085936_0.3236064368393272"},"directories":{}},"0.1.8":{"name":"graphql-anywhere","version":"0.1.8","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"0c696b255b034c3a20683d747965d0921b321be4","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.8","_shasum":"e8389e1eef451f6640ac3126929e9745dd04c06c","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"e8389e1eef451f6640ac3126929e9745dd04c06c","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.8.tgz","integrity":"sha512-ykXF9OLJwE8A5EyOe2VBaZUhtmgHZnIwVLBGgNwdU9W5oVrE9onige4yO8IsCxktQmffHKlNa/aDbxNE9R78Yg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgqT1auGbp8EwliJg60e2tDZpslpoQw3g1mURX7DiL7gIhAOMI5LCUlWt7ASttAw7awkrYsOCIo5tw41ZHLDNRHKMt"}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.8.tgz_1475640829333_0.2056996210012585"},"directories":{}},"0.1.9":{"name":"graphql-anywhere","version":"0.1.9","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.merge":"^4.6.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"bca14588e1cbe2f40d314f2874b381aae71d1b6c","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.9","_shasum":"83eab3e6c62ccbb877c17e92b5adf44ed797fd9c","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"83eab3e6c62ccbb877c17e92b5adf44ed797fd9c","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.9.tgz","integrity":"sha512-M/D/kqaNAhFJgKQARq092pMY5+lSsTqT51BLyQznyf7cLC8/weX+AUQROaz0J1LYz5smPIDqWquUFglTMC1R/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDl/iPkF9ADUZfcNtJlofsjg5YxXasxO5Hkb4opQimk3AiEA5AIVd86hy8NA6tTy2d2Puh1bkUPxz7B6i+pcu6HN7Bw="}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.9.tgz_1475642328915_0.9583455109968781"},"directories":{}},"0.1.10":{"name":"graphql-anywhere","version":"0.1.10","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.merge":"^4.6.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"627ee5439477055af70cbe785321b78c1144b9a0","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.10","_shasum":"c8f09c8d822618a4a1a6be2d2994c955d2ce8876","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"c8f09c8d822618a4a1a6be2d2994c955d2ce8876","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.10.tgz","integrity":"sha512-XWF3xzvYo3K7emDKfCoRSz0CVKVrGb7THyQJWBPzxhnRhO3Ehns/YTlo/H/BkLEPkiGZfagIRGI0beep0vNktw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDSVg6D/l/qDjyzgt2DOVTQoD13AbYO7Uhm0YYMujrpxAiAVr/KNKyfUp1q9PO0wkv3elC2L6LUBGpVN2U/7OLicSw=="}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.10.tgz_1475642716190_0.7541955420747399"},"directories":{}},"0.1.11":{"name":"graphql-anywhere","version":"0.1.11","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.merge":"^4.6.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"bd3164e5816972a36408f1a8bab6dff32242bcf6","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.11","_shasum":"82ce17caea0459734ba2369f9cdc04441244b908","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"82ce17caea0459734ba2369f9cdc04441244b908","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.11.tgz","integrity":"sha512-TXTZZERy7WlhYxffxwopbzAwg5oJSeZBaFFfSJ5DUpISOCgmoVE/CB10MtBLbQHCJY9BsBTK1rieiBX/jDG4lQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwklpp26URbPjsiitgyuw2rYZr2nSB5/rfo3o9rRFKpwIgQBe4pejhQpsKZgOxn7O23q3l3WlDNq7u4qeIeWl8EUM="}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.11.tgz_1475645013254_0.5631137168966234"},"directories":{}},"0.1.12":{"name":"graphql-anywhere","version":"0.1.12","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.merge":"^4.6.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"e5110aca56f90fbf5213e3e3bcd89f7369ed2725","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.12","_shasum":"17c1828e49b974f5457eb93e1bffbe1a5e63f9c4","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"17c1828e49b974f5457eb93e1bffbe1a5e63f9c4","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.12.tgz","integrity":"sha512-Z2tTrdJ069UeCZz6kSn2LnKn7+lnf3mcXr3JrIwfQYTCC7IZGHX5zLOnHgfAv/l72M4/+2DfFjD5TVQuxP4LrA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRSK43GpMdnA/u9wh0YbMeOscWKVAzC5q9JPlfZT/MFgIhAO5DAUfRiUsTj3ESZjnU4ftJ1X155i2MzEsZyGn/B1kg"}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.12.tgz_1475951083454_0.023702293634414673"},"directories":{}},"0.1.13":{"name":"graphql-anywhere","version":"0.1.13","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.merge":"^4.6.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"acd6e1e55918d447ef5445241ad4753f19a74911","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.13","_shasum":"7079faa00c6efa87b0bf455e0cf430e06c557cd0","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"7079faa00c6efa87b0bf455e0cf430e06c557cd0","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.13.tgz","integrity":"sha512-xZZehvcNma04afWFCogUbsfNFgfPczzbRNijJIQmW93e4sQcCvJDHV+yud8CicR6cHV31zeuUppkWwgKMBcHTQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1QhNRoq3vp0VGdJtY2T89z+qqSo/+vVJYIaSXwisClgIgQHIfvAgaIsu7598GUUzB4P+x0jUtork2DRcbI8OQAkY="}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.13.tgz_1476033399003_0.7932947245426476"},"directories":{}},"0.1.14":{"name":"graphql-anywhere","version":"0.1.14","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.merge":"^4.6.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"1d0248d0c5a9b0f9368ffaea0f50a44f8ac73641","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.1.14","_shasum":"409b91995acda41fc6df6fd3471c88987f9d7fc1","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"409b91995acda41fc6df6fd3471c88987f9d7fc1","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.1.14.tgz","integrity":"sha512-RtMrGFZWf/mM0dfStMeU1dTsub6jucNGg4JNBrsl8j97RImH8PqXMNgigYU/Ax/5FUkn81GqbZj6ieAHxZdFEw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4m102SOazfitCLccgmG/msmwbq82LMdIdxejtf+A3DwIhAIt+yyG3fy9hCxCBAdt1oxgiojeOIjj3f5a0zoQsxxxb"}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.1.14.tgz_1476033536539_0.7858137865550816"},"directories":{}},"0.2.0":{"name":"graphql-anywhere","version":"0.2.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.merge":"^4.6.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"f9ed07fbb5971ec24dbe067f404e4c052a8f2c27","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.2.0","_shasum":"de83c91d58fe409ee4c13ecdc0e38b5f5ee7ed49","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"de83c91d58fe409ee4c13ecdc0e38b5f5ee7ed49","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.2.0.tgz","integrity":"sha512-ztqOrGwvD6xqBpGgTrfsIvY/d6kQy6cylh9mAyrDzZudsrZWc+P6bQEyLlW0MktRjM6fAZ+zliMs+poba5xQjg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICQ7vc+i5zsdA4WZmi//6dRG2sOsm+3G1DJjt+EgnsDPAiBPT6jRciupB03f3tjiM8qbtAZ/h34C2pvGu0JnC3HURg=="}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.2.0.tgz_1476374714319_0.6375960055738688"},"directories":{}},"0.2.1":{"name":"graphql-anywhere","version":"0.2.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isarray":"^4.0.0","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.merge":"^4.6.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"aeb17887a463df6433a689c885d6a103c67b09a3","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.2.1","_shasum":"30f499e68133f3e97a10a32387863d5a1beae5a3","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"30f499e68133f3e97a10a32387863d5a1beae5a3","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.2.1.tgz","integrity":"sha512-GvrELIMKl9MDc74gicNXsjlfEzDQEdnJJJ5Q/UJm7rXmGNtEZp1DxqRo8rtx03uJPJdXDnvIFZTpPzM/WgxGlg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCE8SqnQD59kvCyi9ZNhYaPvd45+HCSYYUNPURmQBjjSwIhAKdTKg3aOByl10kXWq2Ko47QnEk9BnV6JiM4nodTB+G3"}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.2.1.tgz_1476375059720_0.3515191408805549"},"directories":{}},"0.2.2":{"name":"graphql-anywhere","version":"0.2.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.merge":"^4.6.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"245413e2fdd4bbb37f8737ccc4bea0a6c2635446","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.2.2","_shasum":"3c26e7e96468655fbfe521211b4ea46aebb343a3","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"3c26e7e96468655fbfe521211b4ea46aebb343a3","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.2.2.tgz","integrity":"sha512-vi20NjMl2IE7YFFv7ja4lUShZVsXH16nP222mN5zgx0MK7pKZF4zy/D7Rgxk4pIvGvSjrTb69KxAM4dsH1WBtA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGomApy554itdZE2rwwEIXuS86OtSmp+REKDz5/zr9nWAiEA8V5M6Yr+ySQhuRD+cENIzuHXBUGWBtjuWtCNdyVfFMA="}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.2.2.tgz_1476574730184_0.06101569579914212"},"directories":{}},"0.2.3":{"name":"graphql-anywhere","version":"0.2.3","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.merge":"^4.6.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"596f4c446da4db04ca77a180f3aa2c4f2426951c","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.2.3","_shasum":"07b65ed29ed9e2ee9e87dd2857d2ab9cafd61429","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"07b65ed29ed9e2ee9e87dd2857d2ab9cafd61429","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.2.3.tgz","integrity":"sha512-YhKWzNj6fIDDZfi7k5h5UKveE+bI8I6rTPovUPcx9L6DILUzJkWslmUhB0HTo6ppYZNYWEfyPu/jl7HhzdJJJg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHtkE2EutHsFZD8fdhGYZcKEaqMwvbG39h/zaDimkjqEAiEAih36+lzxZfARkX08d6eB7IpWw+/U+XMzB/bPV/G7zPM="}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.2.3.tgz_1476574855658_0.8809906472451985"},"directories":{}},"0.2.4":{"name":"graphql-anywhere","version":"0.2.4","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.merge":"^4.6.0","lodash.pick":"^4.2.0"},"devDependencies":{"async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0","typings":"^1.0.0"},"gitHead":"210f5404459ee9aa4620c69b2f11edf5a0b979ea","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.2.4","_shasum":"700d5106dc7fbd39a08084d81a6f543475589774","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"700d5106dc7fbd39a08084d81a6f543475589774","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.2.4.tgz","integrity":"sha512-3lINZxEALPEdSm1VuhMuEj9vQzOFMuJ7ge/RO+V21PxFWRYFu/XMvsjmUUNxawQQftQjBJLML3YTPAd4pSWY5Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWKQfVWs6gDww7NXSwnelO88ciVkSsWQzvR0LKXxOMGwIhANMDZTtCaPLqed6E0QJNyeKD/wdQyM9zykWCHj6PuHME"}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.2.4.tgz_1476863303912_0.0815889136865735"},"directories":{}},"0.3.0":{"name":"graphql-anywhere","version":"0.3.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.merge":"^4.6.0","lodash.pick":"^4.2.0"},"devDependencies":{"@types/chai":"^3.4.34","@types/isomorphic-fetch":"0.0.31","@types/lodash":"^4.14.37","@types/mocha":"^2.2.32","@types/node":"^6.0.46","@types/react":"^0.14.43","@types/react-dom":"^0.14.18","async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typed-graphql":"^1.0.2","typescript":"^2.0.0"},"gitHead":"4c3a500018bcce9cfdd4ce6363e297bbab724412","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@0.3.0","_shasum":"7f8d6b421bbf0fb6322e2a921854c4f5ef357a17","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"tmeasday","email":"tom@percolatestudio.com"},"dist":{"shasum":"7f8d6b421bbf0fb6322e2a921854c4f5ef357a17","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-0.3.0.tgz","integrity":"sha512-bvsoPm/zeqlIkW5Lm2ag9etLNVlnvBkdIqhg36C6Y1dilhxQzOzdc5+RfxmR6ISKZmGrxGsNg9Z7F3mDLHjM4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsrh5HvPjMu5JFD/uFsDW3BWcqLTFY5QiE0zevhqTcvwIhAMaT+NjIDqNq3wRwueh9PRR0vQqrgknFQk+CCqDEpF/D"}]},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"},{"name":"tmeasday","email":"tom@percolatestudio.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/graphql-anywhere-0.3.0.tgz_1479361608538_0.015620717778801918"},"directories":{}},"1.0.0":{"name":"graphql-anywhere","version":"1.0.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash.assign":"^4.0.8","lodash.clonedeep":"^4.3.2","lodash.countby":"^4.4.0","lodash.flatten":"^4.2.0","lodash.forown":"^4.1.0","lodash.has":"^4.3.1","lodash.identity":"^3.0.0","lodash.includes":"^4.1.2","lodash.isequal":"^4.2.0","lodash.isnull":"^3.0.0","lodash.isnumber":"^3.0.3","lodash.isobject":"^3.0.2","lodash.isstring":"^4.0.1","lodash.isundefined":"^3.0.1","lodash.mapvalues":"^4.4.0","lodash.merge":"^4.6.0","lodash.pick":"^4.2.0"},"devDependencies":{"@types/chai":"^3.4.34","@types/isomorphic-fetch":"0.0.31","@types/lodash":"^4.14.37","@types/mocha":"^2.2.32","@types/node":"^6.0.46","@types/react":"^0.14.43","@types/react-dom":"^0.14.18","async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","lodash":"^4.6.1","lodash.mapvalues":"^4.3.0","lodash.omit":"^4.2.1","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typed-graphql":"^1.0.2","typescript":"^2.0.0"},"gitHead":"6ffb3616cfc9b9b920d03207dfb379c5583d1f0f","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@1.0.0","_shasum":"29735317192eb7c9040bf58a11aeeff484c8c18b","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"tmeasday","email":"tom@percolatestudio.com"},"maintainers":[{"name":"sashko","email":"sashko@stubailo.com"},{"name":"tmeasday","email":"tom@percolatestudio.com"}],"dist":{"shasum":"29735317192eb7c9040bf58a11aeeff484c8c18b","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-1.0.0.tgz","integrity":"sha512-t02cQCBlI5Rd5Fxf1HR6vlNlYD5XAi+g5gknli2HdcoUQfZF/GqUfY9/IYmqyvrv0uztSXfleKFb7Zxy1kl/qw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE8HqShkUpqesaNay2wY1FPVzEbiSaxw1JEG0HqP2HlVAiAoVVJHCG24OqpGitHH2n4RMZxH6EuOm/QOGS2QTfzP4A=="}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/graphql-anywhere-1.0.0.tgz_1479868124096_0.9581813807599247"},"directories":{}},"1.1.0":{"name":"graphql-anywhere","version":"1.1.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","devDependencies":{"@types/chai":"^3.4.34","@types/isomorphic-fetch":"0.0.31","@types/lodash":"^4.14.37","@types/mocha":"^2.2.32","@types/node":"^6.0.46","@types/react":"^0.14.43","@types/react-dom":"^0.14.18","@types/graphql":"^0.8.0","async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0"},"gitHead":"09671086b5648c7c5fd5f97f4a6d85a9f4e0e65d","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@1.1.0","_shasum":"623890b8abe0196d124570ac45e64d3eff579f01","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"623890b8abe0196d124570ac45e64d3eff579f01","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-1.1.0.tgz","integrity":"sha512-9bNh31sFJNys1CyA7ZonqeLzTKALZO03QeQ1nv8GpKVHiustgxjfdYBBugYN/8Y1NVYQGKTOuOzJLL2aqFfkAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGxUidAjSCZnPMQEi+mLQjWdrM3aOBdr1VJGfWs7O7/dAiEAxu+Zlb2+Olkz9cXPUVkn0dSm0sjg5JsFH6uYDSKIOto="}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"},{"name":"sashko","email":"sashko@stubailo.com"},{"name":"tmeasday","email":"tom@percolatestudio.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-1.1.0.tgz_1481707270136_0.20941164065152407"},"directories":{}},"1.1.1":{"name":"graphql-anywhere","version":"1.1.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"lodash":"^4.6.0"},"devDependencies":{"@types/chai":"^3.4.34","@types/isomorphic-fetch":"0.0.31","@types/lodash":"^4.14.37","@types/mocha":"^2.2.32","@types/node":"^6.0.46","@types/react":"^0.14.43","@types/react-dom":"^0.14.18","async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typed-graphql":"^1.0.2","typescript":"^2.0.0"},"gitHead":"23ccc536d4b34f0198519ef04db517fa9171c57b","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@1.1.1","_shasum":"98bc0085974a9fb584ee5d602c2de3b6b5019214","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"98bc0085974a9fb584ee5d602c2de3b6b5019214","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-1.1.1.tgz","integrity":"sha512-XiOSBF0XYFKFCkRbL3/Ri8iyRfgcXOy1Ry+bQVJdqMxX/SSZgo5SIE3AENMJ9a0QZF5DslzxOiYpAw560Hbp8A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVDSD6NNzjxQMVse3TtbgHuRmJCVnmYi2DBCOWC4nSJAIgSEfHKbjMVQKQ+UB7ki3rvPoPzYKx6Nt3ooj5B+8O2Yo="}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"},{"name":"sashko","email":"sashko@stubailo.com"},{"name":"tmeasday","email":"tom@percolatestudio.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-1.1.1.tgz_1481709228212_0.16391861787997186"},"directories":{}},"1.1.2":{"name":"graphql-anywhere","version":"1.1.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","devDependencies":{"@types/chai":"^3.4.34","@types/isomorphic-fetch":"0.0.31","@types/lodash":"^4.14.37","@types/mocha":"^2.2.32","@types/node":"^6.0.46","@types/react":"^0.14.43","@types/react-dom":"^0.14.18","async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typed-graphql":"^1.0.2","typescript":"^2.0.0"},"gitHead":"bc8ba42cbac4fa009f966a37228a09f424ca4273","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@1.1.2","_shasum":"897d2868d35723ce7d8b4ead3455c285ea51a2d2","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"897d2868d35723ce7d8b4ead3455c285ea51a2d2","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-1.1.2.tgz","integrity":"sha512-/gUXDP3qkBqv1fKC+DQb0U0j50tJIVsvkf/0t/TagH53E53xJEHADcW2LzHJOE9+KEwK3vaoBMBzznGPpNU92Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4BFpjjnlkgQ6HmDPxyLLUErtdHJYlHZRED5zn324wLQIgbY50n88julMmT/oumu7l+hpZ4loBwKvAJifS2AAcLO0="}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"},{"name":"sashko","email":"sashko@stubailo.com"},{"name":"tmeasday","email":"tom@percolatestudio.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/graphql-anywhere-1.1.2.tgz_1481709852569_0.5881385307293385"},"directories":{}},"2.0.0":{"name":"graphql-anywhere","version":"2.0.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","devDependencies":{"@types/chai":"^3.4.34","@types/isomorphic-fetch":"0.0.31","@types/lodash":"^4.14.37","@types/mocha":"^2.2.32","@types/node":"^6.0.46","@types/react":"^0.14.43","@types/react-dom":"^0.14.18","@types/graphql":"^0.8.0","async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0"},"gitHead":"32720b41b8b74e859acd8990ebe3898cc2d81c49","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@2.0.0","_shasum":"c20d6e6a901d40fa346d9f2b7845266fc59428bd","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"c20d6e6a901d40fa346d9f2b7845266fc59428bd","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-2.0.0.tgz","integrity":"sha512-49KOc4G+aU9bJvbjeT5Ir9ZktoYraeDK5yyipJBW38F+PuBcnGfRI/KIm2NfT5zB5px/Y1S6tfVRwWL4FEMZ8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1Gb1gV8tweIqy6LEW7CcAu0LSBMGXUJx0Ms6fpo161QIhAK/6fXLTuSkoK08/95harSMlnfKVVDekFz8p2h0EcgtA"}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"},{"name":"sashko","email":"sashko@stubailo.com"},{"name":"tmeasday","email":"tom@percolatestudio.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-2.0.0.tgz_1483580319318_0.735160113312304"},"directories":{}},"2.1.0":{"name":"graphql-anywhere","version":"2.1.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","devDependencies":{"@types/chai":"^3.4.34","@types/isomorphic-fetch":"0.0.31","@types/lodash":"^4.14.37","@types/mocha":"^2.2.32","@types/node":"^6.0.46","@types/react":"^0.14.43","@types/react-dom":"^0.14.18","@types/graphql":"^0.8.0","async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0"},"gitHead":"4e0a2030ffdb328c717b8665a4fc2d6fb7dd1eed","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@2.1.0","_shasum":"888c0a1718db3ff866b313070747777380560f69","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"helfer","email":"helfer@meteor.com"},"dist":{"shasum":"888c0a1718db3ff866b313070747777380560f69","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-2.1.0.tgz","integrity":"sha512-hoSpUODp6QJ5QcbfUpW4bmteG088Wy5cDGNL41GpciXbJE1G8dNcSSjKZIeXohccXUdxKAyhUWgpOALpNpLZqg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCIDTOIfXDdLyJs/totzKDJkL5ZerZdql927yaq3crxqDEAh97WUfhArQYFUDYegrZFPB/f5/7oH1JtM7OL9IaT2NY"}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"},{"name":"mdg","email":"npm@meteor.com"},{"name":"sashko","email":"sashko@stubailo.com"},{"name":"tmeasday","email":"tom@percolatestudio.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/graphql-anywhere-2.1.0.tgz_1485384381354_0.31497371941804886"},"directories":{}},"2.2.0":{"name":"graphql-anywhere","version":"2.2.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/stubailo/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","devDependencies":{"@types/chai":"^3.4.34","@types/isomorphic-fetch":"0.0.31","@types/lodash":"^4.14.37","@types/mocha":"^2.2.32","@types/node":"^6.0.46","@types/react":"^0.14.43","@types/react-dom":"^0.14.18","@types/graphql":"^0.8.0","async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^5.2.0","es6-promise":"^3.1.2","graphql-tag":"^0.1.11","grunt":"1.0.1","grunt-tslint":"3.2.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.5.1","source-map-support":"^0.4.0","tslint":"3.15.1","typescript":"^2.0.0"},"gitHead":"b27a7aab101a67186b33269c6b0c47eaf068ca83","bugs":{"url":"https://github.com/stubailo/graphql-anywhere/issues"},"homepage":"https://github.com/stubailo/graphql-anywhere#readme","_id":"graphql-anywhere@2.2.0","_shasum":"652c3fa23a4a6cfeb98817512fb48100b97f3d5c","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"helfer","email":"helfer@meteor.com"},"dist":{"shasum":"652c3fa23a4a6cfeb98817512fb48100b97f3d5c","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-2.2.0.tgz","integrity":"sha512-jGedePlPt+WE19QRyKj9l5jMQZ2l6yWFS5zx77M+Qm0JZQ06eqPal60o1DIWCHxN6eeEPvpSzNgv3haU6z+fHQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIESl/X6GZU60xigHUK5avFHG7pdVmDvLzSBdrU2dSYKbAiAQhbYJws/sE/8+gkYGTF87maft+M8AFNPFqXWQM0ahWg=="}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"},{"name":"mdg","email":"npm@meteor.com"},{"name":"sashko","email":"sashko@stubailo.com"},{"name":"tmeasday","email":"tom@percolatestudio.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-2.2.0.tgz_1486422568953_0.8942051406484097"},"directories":{}},"3.0.0":{"name":"graphql-anywhere","version":"3.0.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","devDependencies":{"@types/chai":"^3.4.34","@types/isomorphic-fetch":"0.0.33","@types/graphql":"^0.8.0","@types/lodash":"^4.14.37","@types/mocha":"^2.2.32","@types/node":"^7.0.5","@types/react":"^15.0.14","@types/react-dom":"^0.14.18","async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^6.0.0","es6-promise":"^4.0.5","graphql-tag":"^1.3.1","grunt":"1.0.1","grunt-tslint":"4.0.1","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.8.0","source-map-support":"^0.4.0","tslint":"^4.5.1","typescript":"^2.2.1"},"gitHead":"c7f111d8d2f8aadff471db1b797c88002513515d","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@3.0.0","_shasum":"bff1cb75a4d1243e85cc68680768a9b5db4879ea","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"helfer","email":"helfer@meteor.com"},"dist":{"shasum":"bff1cb75a4d1243e85cc68680768a9b5db4879ea","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-3.0.0.tgz","integrity":"sha512-3Wmd4pL6YUXAV/UtKPdB/wOWZAFQp86Ju4A1crhNvEzX9/R0mjq8h8sB1k+fXOHWaJ/7/EcQf0Ss2QPzmUekWA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIADBlVBh5gs5ozjezI4NKlt9eRvnbI3c5/gEjwEuyEtuAiEAwypgF/mHV/Q+3YqjnJkXS6jTizlW3fueWVLLDC5uMRE="}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"},{"name":"mdg","email":"npm@meteor.com"},{"name":"sashko","email":"sashko@stubailo.com"},{"name":"tmeasday","email":"tom@percolatestudio.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/graphql-anywhere-3.0.0.tgz_1489628144374_0.6383003639057279"},"directories":{}},"3.0.1":{"name":"graphql-anywhere","version":"3.0.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","devDependencies":{"@types/chai":"^3.4.34","@types/isomorphic-fetch":"0.0.33","@types/graphql":"^0.8.0","@types/lodash":"^4.14.37","@types/mocha":"^2.2.32","@types/node":"^7.0.5","@types/react":"^15.0.14","@types/react-dom":"^0.14.18","async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^6.0.0","es6-promise":"^4.0.5","graphql-tag":"^1.3.1","grunt":"1.0.1","grunt-tslint":"4.0.1","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.8.0","source-map-support":"^0.4.0","tslint":"^4.5.1","typescript":"^2.2.1"},"gitHead":"67056f7c54ccfef54558bd8ee594e5b93f1d02bc","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@3.0.1","_shasum":"73531db861174c8f212eafb9f8e84944b38b4e5a","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"helfer","email":"helfer@meteor.com"},"dist":{"shasum":"73531db861174c8f212eafb9f8e84944b38b4e5a","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-3.0.1.tgz","integrity":"sha512-vIzPr9wvjwVuREYle7Sk1+CPPHRtRYhsjITuKYoFLnKdlxHonIlTDWypm4PH5W1RN+m8+BwcB9OieoN5CydJ/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICUZI9oPUdPouYGemjWXPaRuPivIjg6KSldQ7koZen64AiEA+JraPBcMMEy24wII+aFXiKkTJ26g1wR7X7VeBF5EWKM="}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"},{"name":"mdg","email":"npm@meteor.com"},{"name":"sashko","email":"sashko@stubailo.com"},{"name":"tmeasday","email":"tom@percolatestudio.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/graphql-anywhere-3.0.1.tgz_1489638281758_0.9454973649699241"},"directories":{}},"3.1.0":{"name":"graphql-anywhere","version":"3.1.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublish":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","devDependencies":{"@types/chai":"3.4.35","@types/isomorphic-fetch":"0.0.33","@types/graphql":"^0.9.0","@types/lodash":"^4.14.37","@types/mocha":"^2.2.32","@types/node":"^7.0.5","@types/react":"^15.0.14","@types/react-dom":"^15.5.0","async":"^2.0.0","chai":"^3.5.0","chai-as-promised":"^6.0.0","es6-promise":"^4.0.5","graphql":"^0.10.0","graphql-tag":"^2.0.0","grunt":"1.0.1","grunt-tslint":"5.0.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.8.0","source-map-support":"^0.4.0","tslint":"^5.0.0","typescript":"^2.2.1"},"gitHead":"a858a9fd62e319d5d350d8d90f55be08c7f9e654","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@3.1.0","_shasum":"3ea0d8e8646b5cee68035016a9a7557c15c21e96","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sashko","email":"sashko@stubailo.com"},"dist":{"shasum":"3ea0d8e8646b5cee68035016a9a7557c15c21e96","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-3.1.0.tgz","integrity":"sha512-7+pskZqmSounBJTH5hjzR54BYRAVmKLpntpbUOiq0hp9VKE7Peig6+6UwXjfmK6iVlsqr6OT3TL3980CKQJs6A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHHkLngl8kfPT/XpvIIsrmAb19njQlnpl9tqqHRSJOguAiEA86CPULJiTnNKH1AjUUn668ro94BqyriB8EGzANKcfpk="}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"},{"name":"mdg","email":"npm@meteor.com"},{"name":"sashko","email":"sashko@stubailo.com"},{"name":"tmeasday","email":"tom@percolatestudio.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-3.1.0.tgz_1496641604968_0.15296309534460306"},"directories":{}},"4.0.0-0":{"name":"graphql-anywhere","version":"4.0.0-0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/src/index.js","typings":"./lib/src/index.d.ts","scripts":{"pretest":"npm run compile","test":"npm run testonly --","posttest":"npm run lint","compile":"tsc","watch":"tsc -w","prepublishOnly":"npm run compile","lint":"grunt tslint","coverage":"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","testonly":"mocha --reporter spec --full-trace lib/test/tests.js","compile:browser":"browserify ./lib/src/index.js -o=./lib/index.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/index.min.js -- ./lib/index.js","filesize":"npm run compile:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"*"},"devDependencies":{"@types/chai":"3.5.2","@types/graphql":"~0.9.0","@types/isomorphic-fetch":"0.0.34","@types/lodash":"^4.14.37","@types/mocha":"^2.2.32","@types/node":"^8.0.0","@types/react":"^15.0.14","@types/react-dom":"^15.5.0","async":"^2.0.0","browserify":"^14.4.0","chai":"^4.1.0","chai-as-promised":"^7.0.0","es6-promise":"^4.0.5","graphql":"^0.10.0","graphql-tag":"^2.0.0","grunt":"1.0.1","grunt-tslint":"5.0.0","isomorphic-fetch":"^2.2.1","istanbul":"^0.4.5","mocha":"^3.0.0","react":"^15.3.1","react-dom":"^15.3.1","remap-istanbul":"^0.8.0","source-map-support":"^0.4.0","tslint":"^5.5.0","typescript":"^2.2.1","uglify":"^0.1.5"},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-0","_npmVersion":"5.3.0","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-M4gkJEUwlPRDLdJijHADMCzJpj03vVbQ3IWyxPAq7OKVc5i/wxtOG+lhMp5ridlav6FzUhDfcIcIpe7XU6TDAg==","shasum":"4925da497d766355f81c16f4446115bb91df75c1","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEmjQlzmZ6PCjErklf9FDrqLo3IolmPeAxCTmVi9GGvyAiEArVZuAl5P+YucaK1Zgrue2HWIiB+mvmvr/w9v6536v3k="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-0.tgz_1502480291678_0.6677913251332939"},"directories":{}},"4.0.0-alpha.2":{"name":"graphql-anywhere","version":"4.0.0-alpha.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-alpha.2"},"devDependencies":{"@types/graphql":"~0.9.0","@types/isomorphic-fetch":"0.0.34","@types/jest":"^20.0.7","@types/lodash":"^4.14.37","@types/node":"^8.0.0","@types/react":"^15.0.14","@types/react-dom":"^15.5.0","browserify":"^14.4.0","graphql":"^0.10.0","graphql-tag":"^2.0.0","jest":"^20.0.4","react":"^15.3.1","react-dom":"^15.3.1","ts-jest":"^20.0.10","tslint":"^5.5.0","typescript":"^2.2.1","uglify":"^0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-alpha.2","_npmVersion":"5.3.0","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-WhaUwZ8d9OU2PAsksEz+Urz6drepPC/r3gsqGaEVwhyTZJ8tdFLGaYZiHYY/3ZQmDpXOXWS5hG6qrcULp6r1xA==","shasum":"ce8c377dcf1426a3e2ad4432604054a5bab8f4b6","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-alpha.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfQ1eFVY8AD6IzXTAU/1Mymqw2yYAjPQQq4rGskIVInwIgWtNrHk3cyFkcdJ9fKwk6DBDwl4GKz8vQr1y06mn5fNY="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-alpha.2.tgz_1504496573010_0.8185339611954987"},"directories":{}},"4.0.0-alpha.3":{"name":"graphql-anywhere","version":"4.0.0-alpha.3","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-alpha.3"},"devDependencies":{"@types/graphql":"~0.9.0","@types/isomorphic-fetch":"0.0.34","@types/jest":"^20.0.7","@types/lodash":"^4.14.37","@types/node":"^8.0.0","@types/react":"^15.0.14","@types/react-dom":"^15.5.0","browserify":"^14.4.0","graphql":"^0.10.0","graphql-tag":"^2.0.0","jest":"^20.0.4","react":"^15.3.1","react-dom":"^15.3.1","ts-jest":"^20.0.10","tslint":"^5.5.0","typescript":"^2.2.1","uglify":"^0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-alpha.3","_npmVersion":"5.4.0","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-RXje3vVMNNwoJyzLjrbR8KzTGxjMIcBIuv0ehSAvSp8/pP+Ltskez3evcPiEH0wBTeF1Vo7GwgibtsBqchW5/w==","shasum":"e87f8dcd1bbc3df23d4e66e22aa6b1185daffc6e","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-alpha.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPTfaYUE/vDcTDddbSwY8I7xiKZJtTdNfcbN92Af+BKQIgK/1WZbuoyzP09DwEfcu1p+Wp2ewnMxB+ZBR5k3E0Tmw="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-alpha.3.tgz_1504625974601_0.8624331804458052"},"directories":{}},"4.0.0-alpha.4":{"name":"graphql-anywhere","version":"4.0.0-alpha.4","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-alpha.4"},"devDependencies":{"@types/graphql":"~0.9.0","@types/isomorphic-fetch":"0.0.34","@types/jest":"^20.0.7","@types/lodash":"^4.14.37","@types/node":"^8.0.0","@types/react":"^15.0.14","@types/react-dom":"^15.5.0","browserify":"^14.4.0","graphql":"^0.10.0","graphql-tag":"^2.0.0","jest":"^20.0.4","react":"^15.3.1","react-dom":"^15.3.1","ts-jest":"^20.0.10","tslint":"^5.5.0","typescript":"^2.2.1","uglify":"^0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-alpha.4","_npmVersion":"5.4.0","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-OM2W4x9zn+d/P6N6J6Zfe1zL61g1rZVuo52rc5d0pezrGQ4qBDDq3VebG593gV1j9pidfY1kFtQ8G6Er17ldug==","shasum":"3e94a7c7ec1d85f12f5211aa8eaaf6335f5f6260","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-alpha.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8cSWy3kPjWZzsRRAuzIQyDfHa8uQk/GWqg6ErmvJ+ggIhAMAgz/fjkh5mT+9zXrZ4a8C46A3mvDMTs3iJ6LwvkmLI"}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-alpha.4.tgz_1504755847953_0.9161838435102254"},"directories":{}},"4.0.0-alpha.5":{"name":"graphql-anywhere","version":"4.0.0-alpha.5","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-alpha.5"},"devDependencies":{"@types/graphql":"~0.9.0","@types/isomorphic-fetch":"0.0.34","@types/jest":"^20.0.7","@types/lodash":"^4.14.37","@types/node":"^8.0.0","@types/react":"^15.0.14","@types/react-dom":"^15.5.0","browserify":"^14.4.0","graphql":"^0.10.0","graphql-tag":"^2.0.0","jest":"^20.0.4","react":"^15.3.1","react-dom":"^15.3.1","ts-jest":"^20.0.10","tslint":"^5.5.0","typescript":"^2.2.1","uglify":"^0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-alpha.5","_npmVersion":"5.4.0","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-Qg9eYOUy1Ifb/+OhD7R9c3ujZxzFNv/XgpsHFiOqBLXGsJsSC/tZYjE95DuEGtNfhmypXsfDLsEOwgwTNPCOIQ==","shasum":"a266e3a4db741fd26f3ed8347336d5b2a3e79265","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-alpha.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDXhmdQj+DSh7JeLOTeHLKCH8PRkHiERDWOyawtGap6ZAiEAxwjpIDIEia1VYfOhvRWXYe12fli/yC8PoqVeFXOVTwg="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-alpha.5.tgz_1504844682072_0.1684847641736269"},"directories":{}},"4.0.0-alpha.6":{"name":"graphql-anywhere","version":"4.0.0-alpha.6","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-alpha.6"},"devDependencies":{"@types/graphql":"~0.9.0","@types/isomorphic-fetch":"0.0.34","@types/jest":"^20.0.7","@types/lodash":"^4.14.37","@types/node":"^8.0.0","@types/react":"^15.0.14","@types/react-dom":"^15.5.0","browserify":"^14.4.0","graphql":"^0.10.0","graphql-tag":"^2.0.0","jest":"^20.0.4","react":"^15.3.1","react-dom":"^15.3.1","ts-jest":"^20.0.10","tslint":"^5.5.0","typescript":"^2.2.1","uglify":"^0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-alpha.6","_npmVersion":"5.4.0","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-6q6ZwuAo4icb/isU6Wt4D1v74t1DM08kttNR0GzwvTZ9t64iWXIDNwWUe/A2qn2iMogHYu2DshUiXfB4USzNvg==","shasum":"cd000fea2275e063e4a580b1f9ede8fb98d1da80","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-alpha.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHfpTVjsgi1bdIdgnMFr++yCEBZA8RH+YmuOIoMRW3cnAiEAkOiXSBS8yrgr/jInOSmBBnvDbk2xkhhTiyvd1aMxd8A="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-alpha.6.tgz_1504892002465_0.08030597190372646"},"directories":{}},"4.0.0-beta.0":{"name":"graphql-anywhere","version":"4.0.0-beta.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-beta.0"},"devDependencies":{"@types/graphql":"~0.9.0","@types/isomorphic-fetch":"0.0.34","@types/jest":"^20.0.7","@types/lodash":"^4.14.37","@types/node":"^8.0.0","@types/react":"^15.0.14","@types/react-dom":"^15.5.0","browserify":"^14.4.0","graphql":"^0.10.0","graphql-tag":"^2.0.0","jest":"^20.0.4","react":"^15.3.1","react-dom":"^15.3.1","ts-jest":"^20.0.10","tslint":"^5.5.0","typescript":"^2.2.1","uglify":"^0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-beta.0","_npmVersion":"5.4.1","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-kXv9HrU5FPu3gXUlgU9FIZNtyBXJbMZQM58HOymfR7duJqeA8MDZG+uAG9ZMlPIuFZKQBCR3yGv46LrEnPAe/w==","shasum":"40fcf25b8e0933320c22baef9768f59dce9310e5","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-beta.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+0eMZzC0iVIfolgiS9mnS1/AU5Q12PQvysFfSv81OkwIhANtSNdQOrdrxyCDjtViwzOK/5GBFzbAAj1fyvhTquSxU"}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-beta.0.tgz_1505315378173_0.054268728010356426"},"directories":{}},"4.0.0-beta.1":{"name":"graphql-anywhere","version":"4.0.0-beta.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-beta.1"},"devDependencies":{"@types/graphql":"0.9.4","@types/isomorphic-fetch":"0.0.34","@types/jest":"20.0.8","@types/lodash":"4.14.74","@types/node":"8.0.28","@types/react":"16.0.5","@types/react-dom":"15.5.4","browserify":"14.4.0","graphql":"0.11.3","graphql-tag":"2.4.2","jest":"20.0.4","react":"15.6.1","react-dom":"15.6.1","ts-jest":"20.0.14","tslint":"5.7.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-beta.1","_npmVersion":"5.4.2","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-vRp4tEoT53rgPmmq1zqid4BbjLGZJ1vNortf1pUNOBGkWkyWgv/Qtrf8NMt1hMfj0k8pZiddA4wqNeI+yBd/2A==","shasum":"e7ec4a8056869232f92ecbdb626c6b0f1e524d41","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-beta.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE3KR0yuAFHZu2fpCyUs/YJsp0Uhfv6nWUAbjJYPnztjAiEA9AkxgEF4DsqAsQelITPjghEOEs+hyMCIZDXGp1FM7/M="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-beta.1.tgz_1505997724457_0.30224178987555206"},"directories":{}},"4.0.0-beta.2":{"name":"graphql-anywhere","version":"4.0.0-beta.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-beta.2"},"devDependencies":{"@types/graphql":"0.9.4","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.1","@types/lodash":"4.14.76","@types/node":"8.0.31","@types/react":"16.0.7","@types/react-dom":"15.5.4","browserify":"14.4.0","graphql":"0.11.3","graphql-tag":"2.4.2","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","ts-jest":"20.0.14","tslint":"5.7.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-beta.2","_npmVersion":"5.4.2","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-dZUsiGFmYrh7/3WzURKK64RvADw8wzGJeBtsmzdhV5TROpa8IvsxUDmjST4Z6WIxzQtNG70UcBP93MqCcPDkAA==","shasum":"729edc9ea733015445a73f72535a5117b9049110","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-beta.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJCIm8qv9wJnDNm69JMhtJGdY52rxmL4mE6XP9ntFt6QIgAhpj3bothtAZYhDU3nIMbuvRL6JE2PfabOaqDPRUnnA="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-beta.2.tgz_1506435030904_0.4621222629211843"},"directories":{}},"4.0.0-beta.3":{"name":"graphql-anywhere","version":"4.0.0-beta.3","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-beta.2"},"devDependencies":{"@types/graphql":"0.9.4","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.1","@types/lodash":"4.14.76","@types/node":"8.0.31","@types/react":"16.0.7","@types/react-dom":"15.5.5","browserify":"14.4.0","graphql":"0.11.3","graphql-tag":"2.4.2","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","ts-jest":"20.0.14","tslint":"5.7.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-beta.3","_npmVersion":"5.4.2","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-rXjamzX2K9SwfG3TRxfr5Vk8bWTVnvDzz2Ps4BkHhf9wraDox60qAzGPThnJ6KtZfaG95OV6VnLn5H9lD8qVzw==","shasum":"8ea8211e7de2ae1a81cebe261735e1defbeb4824","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-beta.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPGKKBXn0U98DGJ7r9y1AtUj4K4ogQoUaUsxOPbeTREgIhANfLbAdd9GdeZcNwtfeejXzKN5+hrZgnyiWDtEtjjFwH"}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-beta.3.tgz_1507056194523_0.6991730346344411"},"directories":{}},"4.0.0-beta.4":{"name":"graphql-anywhere","version":"4.0.0-beta.4","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-beta.3"},"devDependencies":{"@types/graphql":"0.9.4","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.2","@types/lodash":"4.14.77","@types/node":"8.0.33","@types/react":"16.0.10","@types/react-dom":"16.0.1","browserify":"14.4.0","graphql":"0.11.7","graphql-tag":"2.4.2","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","ts-jest":"20.0.14","tslint":"5.7.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-beta.4","_npmVersion":"5.4.2","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-rrzcFuOvsir1A+lTXdv1ewTTjqP4Cb7n/wl9FibHg0OR3T0smUoye6uxyXE55RK1dhWwJ4phzs3nuRQsl49DVA==","shasum":"0a245a204cff6beb085cf76ff1587edccd88f2f4","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-beta.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDg7W0RiPwHBvAtnLCKjK0eABFZ/aeDZJhgIE6IRcJwSAiEAxzK/AochKb46dQdu7zJ3ibaI2cTq0C8rqRjqIs31HcQ="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-beta.4.tgz_1507687831601_0.825680103385821"},"directories":{}},"4.0.0-beta.5":{"name":"graphql-anywhere","version":"4.0.0-beta.5","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-beta.4"},"devDependencies":{"@types/graphql":"0.9.4","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.2","@types/lodash":"4.14.77","@types/node":"8.0.34","@types/react":"16.0.10","@types/react-dom":"16.0.1","browserify":"14.4.0","graphql":"0.11.7","graphql-tag":"2.4.2","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","ts-jest":"20.0.14","tslint":"5.7.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-beta.5","_npmVersion":"5.4.2","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-1udr8+I8g0nx1ch36JZZLvI9PTzmIJn0X09qIT6KiDaaX6w2wv/RL6Q69qAD2YbhlSgkZV6c80P4veSEuOzYcA==","shasum":"9fe33155436cdb0db4b661cabd26d87307fda4c7","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-beta.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBh4n1G5txcmAY8e1e678fiuze4CcM1JWpaW62YWUFTtAiEAgqXrFSNuj9sA62gnsgDrNaZp3oAZHo48PxIVG3/ozAA="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-beta.5.tgz_1507708870869_0.5164775997400284"},"directories":{}},"4.0.0-rc.0":{"name":"graphql-anywhere","version":"4.0.0-rc.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-rc.0"},"devDependencies":{"@types/graphql":"0.9.4","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.2","@types/lodash":"4.14.77","@types/node":"8.0.34","@types/react":"16.0.10","@types/react-dom":"16.0.1","browserify":"14.4.0","graphql":"0.11.7","graphql-tag":"2.4.2","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","ts-jest":"20.0.14","tslint":"5.7.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-rc.0","_npmVersion":"5.4.2","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-ggwx5wLOviiPRGtS45RXa9jrxTAQD7Og9uLHJy0NCDhVsjbEBRg67NEuw43trc9/17pz6bT3E2IZEadn18fVBg==","shasum":"5c062585f254767e77616ba1064dda44a535dd0e","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-rc.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHLFqXHh7nIlpYwX4HeYT2bP3prgM46wcfZZnyMnpfx+AiAj4y6yedAZWlKJN8jYtZkPk3Mjnfdr6pCks2a3bXJ9cA=="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-rc.0.tgz_1507709398509_0.7433719309046865"},"directories":{}},"4.0.0-rc.1":{"name":"graphql-anywhere","version":"4.0.0-rc.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-rc.1"},"devDependencies":{"@types/graphql":"0.9.4","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.2","@types/lodash":"4.14.77","@types/node":"8.0.41","@types/react":"16.0.10","@types/react-dom":"16.0.1","browserify":"14.4.0","graphql":"0.11.7","graphql-tag":"2.4.2","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","ts-jest":"20.0.14","tslint":"5.7.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-rc.1","_npmVersion":"5.5.1","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-lU6HSdza9Kwjq5vfBfnx6z0gdT1qjkR9/Fr3H68CocAD3nQf7KjuHBkgY4VJyiS4fxAVuPBRTiwGhlzbL0masQ==","shasum":"d714406ceac7b69c09e9682243e612303514d7f7","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-rc.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/bp4XaEnYd4uJ4wAvQYf5G+hmuvzL2iAROwO6TNoDzAiAfu1TYAD6tVjVQkFqFMuvJfhTX5UbV5q47O6LppQmS2g=="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-rc.1.tgz_1508457909695_0.9378817223478109"},"directories":{}},"4.0.0-rc.2":{"name":"graphql-anywhere","version":"4.0.0-rc.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-rc.2"},"devDependencies":{"@types/graphql":"0.9.4","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.2","@types/lodash":"4.14.78","@types/node":"8.0.46","@types/react":"16.0.15","@types/react-dom":"16.0.2","browserify":"14.5.0","graphql":"0.11.7","graphql-tag":"2.4.2","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","ts-jest":"20.0.14","tslint":"5.7.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-rc.2","_npmVersion":"5.5.1","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-mQqowKGufoR25VbDAxW/tNsPwYIZ1TGoYEd4fT0d9uFEDg06S447vIemRw7TbHntnuQA/qgFauiDRnpKfqHAAw==","shasum":"b666ecb56312cba8e91f703c6657943e469be3bf","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-rc.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEIfaGma5gq+avtdBA0zV7YAO1xx/hJC0APQhWCV8fSQIhAJwM6bu7oihwCWwST1PXvmXSmut+1fVFm6ZPXuamSi7d"}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-rc.2.tgz_1508509583464_0.6124173614662141"},"directories":{}},"4.0.0-rc.3":{"name":"graphql-anywhere","version":"4.0.0-rc.3","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^0.2.0-rc.3"},"devDependencies":{"@types/graphql":"0.9.4","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.2","@types/lodash":"4.14.78","@types/node":"8.0.46","@types/react":"16.0.18","@types/react-dom":"16.0.2","browserify":"14.5.0","graphql":"0.11.7","graphql-tag":"2.4.2","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","ts-jest":"20.0.14","tslint":"5.8.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0-rc.3","_npmVersion":"5.5.1","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-r3SQQL4w/Frxlufn+UD6x2PR3Swyjnyo+G78bgxRKDH6sU0gzhQid9/ACofvfA/+3BmubxQebFa5Yrtb4KW1vQ==","shasum":"b47e76b662a3f851e8c3b4ad496ea3e885994883","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0-rc.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG/foWYXtMPpzKPwJE99vzYGMjhg6ejmdbAXY6ATCSXBAiAjsJeoL1t1RCcD+vMfPd8ROUkqoJu6y1p4+Egcqp8vtA=="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0-rc.3.tgz_1508822847644_0.05307959415949881"},"directories":{}},"4.0.0":{"name":"graphql-anywhere","version":"4.0.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/index.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^1.0.0"},"devDependencies":{"@types/graphql":"0.9.4","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.2","@types/lodash":"4.14.78","@types/node":"8.0.46","@types/react":"16.0.18","@types/react-dom":"16.0.2","browserify":"14.5.0","graphql":"0.11.7","graphql-tag":"2.4.2","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","ts-jest":"20.0.14","tslint":"5.8.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.1.2","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-MhNgKWrbxIRKMqyjAqtqQQzdlvcv+4DmiznMil6+yBKczizkLrEAQcR2NpIw9W3LfXnEfacXsMDhJwy0S00y5Q==","shasum":"4cf7ae7ed93aabeb95d329caa08c3867ddaef45e","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYplAhK5XBY1gYN5fBXBlZQy9nqtiu5RtLUK0/Xkt9hAIhAKvv8if5BGK2P92Zwq2DmiB1NJW5S7kN9t/1yhGiC8Xn"}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.0.tgz_1508871137540_0.30725579615682364"},"directories":{}},"4.0.1":{"name":"graphql-anywhere","version":"4.0.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"/lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^1.0.2"},"devDependencies":{"@types/graphql":"0.9.4","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.6","@types/lodash":"4.14.85","@types/node":"8.0.52","@types/react":"16.0.22","@types/react-dom":"16.0.3","browserify":"14.5.0","graphql":"0.11.7","graphql-tag":"2.4.2","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","rollup":"0.50.0","ts-jest":"20.0.14","tslint":"5.8.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-mYjTxEjyyIIraUI8RJKaQsVEP1aXXuCtG6R07On2rY1/IlnYI4YVf40oI7H8zD6UMmNstwisFis9laSFQZxeAw==","shasum":"eb53ed5c56ef42e21d34dc22951e3da38f88a342","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH37e9m4ZannCy3HtMWjJFJzttc5mVieNXJ/a/2CnFRfAiEA+FD/wwxps8GAFHbytSZ4AJMzyTj+9WRantKCoS/hU4Q="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.1.tgz_1510801046938_0.9454367654398084"},"directories":{}},"4.0.2":{"name":"graphql-anywhere","version":"4.0.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"/lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^1.0.3"},"devDependencies":{"@types/graphql":"0.11.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.8","@types/lodash":"4.14.86","@types/node":"8.0.53","@types/react":"16.0.25","@types/react-dom":"16.0.3","browserify":"14.5.0","graphql":"0.11.7","graphql-tag":"2.4.2","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","rollup":"0.52.0","ts-jest":"20.0.14","tslint":"5.8.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.0.2","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-nCjKwOKZ52G1ObR1ct9rotuLKvOMun0h14SRwMvq37rh3uuTQBilXPk5xr9nM2yQhR0cUjikmDkM8uD4Msgoqg==","shasum":"1dd13a53a659c5e09d0b6ccecfba771ee4939fa1","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHjucDlo7+tZONFPHFdOdpAcqS60O0At6inr7kq+JIb9AiEA8R5Iyk2tkQPw01dSHuDxsHhlIL042sSkZnYUQzICl0Y="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.0.2.tgz_1512068598390_0.3078922759741545"},"directories":{}},"4.1.0-alpha.0":{"name":"graphql-anywhere","version":"4.1.0-alpha.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^1.0.2"},"devDependencies":{"@types/graphql":"0.11.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.8","@types/lodash":"4.14.87","@types/node":"8.0.53","@types/react":"16.0.25","@types/react-dom":"16.0.3","browserify":"14.5.0","graphql":"0.11.7","graphql-tag":"2.4.2","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","rollup":"0.52.0","ts-jest":"20.0.14","tslint":"5.8.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.0-alpha.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-fwRewU+vAJXOIEN2DptZyDWDPgML7l3ArgxWpH8ihTpMf9K0eH7QhkBclxE7PjjnE6wc0obZfJLFv9vJc6sM5g==","shasum":"43b47b403e70288363222b25adaeb81c799acfbe","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.0-alpha.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCspKxBTHgpS0gUKGGgEyZ0teKGyisV2wq0snIPiNtiMAIhAOopWLxv5oEyKbZt/uBqeKIgo0LKQSAoOY2m2cT1JfOz"}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.1.0-alpha.0.tgz_1512479597898_0.025409777648746967"},"directories":{}},"4.1.0":{"name":"graphql-anywhere","version":"4.1.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^1.0.3"},"devDependencies":{"@types/graphql":"0.11.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.8","@types/lodash":"4.14.88","@types/node":"8.0.57","@types/react":"16.0.28","@types/react-dom":"16.0.3","browserify":"14.5.0","graphql":"0.11.7","graphql-tag":"2.6.0","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","rollup":"0.52.1","ts-jest":"20.0.14","tslint":"5.8.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-fY6WVG7NLMjyGwjH71bc0zYcYhxjxk2wqMb7QwbNRFIy1nVNO4HGEfboajTydPxckkMbtnleS9uMUZSHNt1rPA==","shasum":"87c12f488e7c4c357f0045cb5208a35d12171d36","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEY+1W1auJHfOui8OzUxOZCsYbsKp2ul6edM/ED6t4eiAiEAwXIEYv7SVdfiNFXGiJO/5yHX1xeNFqz0B1g0wPdGkOg="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.1.0.tgz_1512746953367_0.4275942777749151"},"directories":{}},"4.1.1":{"name":"graphql-anywhere","version":"4.1.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^1.0.4"},"devDependencies":{"@types/graphql":"0.11.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.10","@types/lodash":"4.14.92","@types/node":"8.5.5","@types/react":"16.0.34","@types/react-dom":"16.0.3","browserify":"15.0.0","graphql":"0.12.3","graphql-tag":"2.6.1","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","rollup":"0.53.3","ts-jest":"20.0.14","tslint":"5.8.0","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.0","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-CMbuqNbp6nfHfOHswrDuEed+MxDSnLppHKjjte447P6fllqZi69D2bS/3QSfK/KONSgvpk3ptxNi4fR6WQFcSQ==","shasum":"67924b67b053d1a23bc30d0e4c8db943c1d791a8","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8EuzXcJNp0yhQ/DI9nfWHgMdAMpoIvGTc0ySh4DihKQIhAKDbalck1OZevM2DQ0HMZ0X2WNpJ907CZo0/henB+MQj"}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.1.1.tgz_1515184509362_0.6254295376129448"},"directories":{}},"4.1.2":{"name":"graphql-anywhere","version":"4.1.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^1.0.5"},"devDependencies":{"@types/graphql":"0.12.3","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.10","@types/lodash":"4.14.97","@types/node":"8.5.9","@types/react":"16.0.34","@types/react-dom":"16.0.3","browserify":"15.2.0","graphql":"0.12.3","graphql-tag":"2.6.1","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","rollup":"0.55.1","ts-jest":"20.0.14","tslint":"5.9.1","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.2","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-Zbv7LJFpked13nu78yT2fCC4ppgP0kGko0A1JVTwgOjiqFB9mSMdGFyuqwNA6t79QDN3YE/xwppMqe3fmJ5v+w==","shasum":"55e58593158f3deb0814def522c55e948c57cabb","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQ1PJB5Hqrb1B1TWf7R+jtlnqMoqH+XLvv1j1RWsc4ZAIgQjYY32H2dvtAQBf92XGGaNA0pgu9hmTr8pysU2em1e0="}]},"maintainers":[{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"helfer@meteor.com","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.1.2.tgz_1517247048693_0.0298357002902776"},"directories":{}},"4.1.3":{"name":"graphql-anywhere","version":"4.1.3","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^1.0.6"},"devDependencies":{"@types/graphql":"0.12.3","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.10","@types/lodash":"4.14.97","@types/node":"8.5.9","@types/react":"16.0.34","@types/react-dom":"16.0.3","browserify":"15.2.0","graphql":"0.12.3","graphql-tag":"2.6.1","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","rollup":"0.55.1","ts-jest":"20.0.14","tslint":"5.9.1","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.3","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-WYdNIRANlQrc0H1Dt9GkSWKthERSetjx6rKcPUTkhnhmqCzqlZ0K/KVBqhAQ7sqhV9d0m3BeiB5y2HqAkg4mIg==","shasum":"ddd857d45d1538f55e8364c6c7a9016817a5ea92","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKe1dzNS3lHSpTWxazczV1DLcTSwhxGIrinivyxKG4CQIhAKcerdAjERR+M+OmbDOkZEbq9YeJv3zqCrE7b8n9x2S/"}]},"maintainers":[{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"tom@thesnail.org","name":"tmeasday"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere-4.1.3.tgz_1517587216712_0.8878709215205163"},"directories":{}},"4.1.4":{"name":"graphql-anywhere","version":"4.1.4","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^1.0.7"},"devDependencies":{"@types/graphql":"0.12.3","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.10","@types/lodash":"4.14.97","@types/node":"8.5.9","@types/react":"16.0.34","@types/react-dom":"16.0.3","browserify":"15.2.0","graphql":"0.12.3","graphql-tag":"2.6.1","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","rollup":"0.55.5","ts-jest":"20.0.14","tslint":"5.9.1","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.4","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"peggyrayzis","email":"peggyrayzis@gmail.com"},"dist":{"integrity":"sha512-riuK0ueAp3+XuuL5hUW72ZarvHK4KCbrDs9+DdWFPkKFyCQVqntBhvuwQHziv+h7R+6d4msgCavfkGApWIBFrw==","shasum":"0f20fc3dc85d13cc83c8a3330376f36b8d710888","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.4.tgz","fileCount":35,"unpackedSize":140080,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDvQNw3ljqnm8q2p11A+h6qMaN/ICXC//6Lwh2LEhYR4AiBtlFkOPmuNu6QbmVbrVU6HOCSLgzeFSeUncjTvomdZeQ=="}]},"maintainers":[{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.4_1518639382695_0.8269286510588278"},"_hasShrinkwrap":false},"4.1.5":{"name":"graphql-anywhere","version":"4.1.5","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"license":"MIT","dependencies":{"apollo-utilities":"^1.0.8"},"devDependencies":{"@types/graphql":"0.12.3","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.10","@types/lodash":"4.14.97","@types/node":"8.5.9","@types/react":"16.0.34","@types/react-dom":"16.0.3","browserify":"15.2.0","graphql":"0.12.3","graphql-tag":"2.6.1","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","rollup":"0.55.5","ts-jest":"20.0.14","tslint":"5.9.1","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.5","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"peggyrayzis","email":"peggyrayzis@gmail.com"},"dist":{"integrity":"sha512-M/5tK73y3JDpwOKShrwuQGu4bo2Mm3DqiTfkUcmvxONfyDTwvf8qn/TVe59yC0SbwNbFiVbZigXgijP+3riyBA==","shasum":"552ccd27b79a13a899022e20f658a2c2cb75e251","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.5.tgz","fileCount":35,"unpackedSize":140080,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICCCJ2iXL2q7pjnXdJWVFJimY+p75r3ZHMgwFRjPCtbqAiAWQTBAOta46AzNwRWX1NuyTSlUcFfJvAiyBNt377M9mQ=="}]},"maintainers":[{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.5_1518652572978_0.48887792570786837"},"_hasShrinkwrap":false},"4.1.6":{"name":"graphql-anywhere","version":"4.1.6","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.9"},"devDependencies":{"@types/graphql":"0.12.4","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.10","@types/lodash":"4.14.102","@types/node":"8.5.9","@types/react":"16.0.34","@types/react-dom":"16.0.3","browserify":"15.2.0","graphql":"0.13.1","graphql-tag":"2.8.0","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","rollup":"0.56.4","ts-jest":"20.0.14","tslint":"5.9.1","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"mapCoverage":true},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.6","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"peggyrayzis","email":"peggyrayzis@gmail.com"},"dist":{"integrity":"sha512-m2fVrW1Phk8Zv50jDU034nz0cyHpcLpWCZxWdOLNd3cYQ5lhaNI4o2/NlyuDEnUzQE+ttdKhhgYBM2NovDe7JQ==","shasum":"1329ee62c76ff363aa44570d12067178b8611dca","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.6.tgz","fileCount":35,"unpackedSize":140216,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKnnvry3UBQ7QmLsJzaozLBs18M/icfSHmYxzylT5e6QIhAK2sqCtuunWR35OLq33HKC4gIEG+H9fTiatyscMa8Fbn"}]},"maintainers":[{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.6_1520355729698_0.12523245921431703"},"_hasShrinkwrap":false},"4.1.7":{"name":"graphql-anywhere","version":"4.1.7","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.10"},"devDependencies":{"@types/graphql":"0.12.4","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.10","@types/lodash":"4.14.102","@types/node":"8.5.9","@types/react":"16.0.34","@types/react-dom":"16.0.3","browserify":"15.2.0","graphql":"0.13.1","graphql-tag":"2.8.0","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","rollup":"0.56.4","ts-jest":"20.0.14","tslint":"5.9.1","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"mapCoverage":true},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.7","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"peggyrayzis","email":"peggyrayzis@gmail.com"},"dist":{"integrity":"sha512-sgp/p1bWVZ/74BAAi6iy4MF/k7h4tfmXM5LV9c+EsImCfzOROJa0aOIwHOdLrtRhxq0vmw1sO6aSDnxJQpTzHA==","shasum":"cbb9106905bcc25bc0e8390548a97f8b154d3f9b","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.7.tgz","fileCount":35,"unpackedSize":140217,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHoPEDFEwZagUtNbuCv/4Blhe1n9R5v6J3CZF+0XLEMfAiAvuAaA3LqLlZcuhH8yVKIoP720jRMXfcwoEq2vAwHh7Q=="}]},"maintainers":[{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.7_1520962036527_0.9194330861828783"},"_hasShrinkwrap":false},"4.1.8":{"name":"graphql-anywhere","version":"4.1.8","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.11"},"devDependencies":{"@types/graphql":"0.12.5","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.10","@types/lodash":"4.14.105","@types/node":"8.9.5","@types/react":"16.0.34","@types/react-dom":"16.0.3","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.8.0","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","rollup":"0.56.4","ts-jest":"20.0.14","tslint":"5.9.1","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.8","_npmVersion":"5.8.0","_nodeVersion":"9.4.0","_npmUser":{"name":"jbaxleyiii","email":"james@meteor.com"},"dist":{"integrity":"sha512-beHsTvul0izwSTA4Av0V5QNx5WKa4rsdiYZ8xBs08x7ya4+hpuXSMye4uztqIUqCBhI0BpvfTuGvXyPeYCNwgQ==","shasum":"23882e6a16ec824febbe5bca40937cdd76c5acdc","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.8.tgz","fileCount":49,"unpackedSize":257797,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFzK+/Pc6bCppepCNOkqIMHlJrraDElt+NWirNuP1RCdAiEAjEnBipq/tl84jJjlsbSrmwEfpFDT3j677oKhQzqBZc8="}]},"maintainers":[{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.8_1522071353994_0.4939885365200678"},"_hasShrinkwrap":false},"4.1.9":{"name":"graphql-anywhere","version":"4.1.9","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.12"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.10","@types/lodash":"4.14.108","@types/node":"8.10.11","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","rollup":"0.58.2","ts-jest":"20.0.14","tslint":"5.9.1","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.9","_npmVersion":"5.8.0","_nodeVersion":"8.11.1","_npmUser":{"name":"benjamn","email":"ben@benjamn.com"},"dist":{"integrity":"sha512-/Jhj+KaNuXQbgVsD7usuyNV/RHjNYH/GMr0mYiAAp8+TpoP3Q1AokHQePizZ7ck4kPfZmJ724aBc5gK1WCDTjQ==","shasum":"831bbf2c4972bd104a60175ba107ab3ae65008d1","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.9.tgz","fileCount":35,"unpackedSize":142516,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6gL5CRA9TVsSAnZWagAAV2EP/1FC21WEqL53JvsMzdD8\nCZ4kqAwS4hHL3+T2CcHwj3NKlukHYak3prBpdfV2diF+BgXpYRKLbX5vRnJt\noiqab9IaDGHPI9Sij8yNF+StaveiO6lT6UE11ZAEZKuOoB48D3Tj0gyPTGDf\ncHLgTeoSvs7XBYZRFWL6qX1305yTWgbHyqwzkggZAKKABiaAUu3sR+UlfOFv\n8eH2Vw4oCdmARHJ2eXZJqIbghQdsjWeC4SD6WOhrkYSKYV0ZIZuHhHTgclNt\nfOSqX5rOr2yWqb4NF8zBF8vC3J05SRv91y7SglDavfqPmk41ID9iJRwzHx7h\nmpNFCeqNh7+5GUJQi2NFmGO61/4+0FUS8TB6TSkWN0aLvrmHqa73d/VePMIv\nyNfEKUjf5DtSKhRAz1GcCLuljDIuC8xVVOPWYC+srvJd2C9t0k6b+dxK9EB0\nEvn+cMsA6isFgTAUmRvJ/mVgzw3JhwziFGJR9kIPEDD93jE/Bfd14N0qKKri\nPnPeEcQQblDuBwit41w0n8myCd0mYUDScwO1mQE523VC99TRyuoJ82p+LXAS\noO9OVNbj09JGIl3xK57zmpIkrGZkPju3reeN/3KHray9Web5qJfhQnPXp3y8\npAy51BD/B7GUSAA2Rtbq/WqzBH80VKXNYbCt3rY9o7sEok8/l58zzuaS8NkH\nJs1W\r\n=LHuc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9OBGol2wnbJgGHZ1bD7FQeNSJ5djhOaf7JHgIVe6dLAIgZJSC9klxpCZWNJwSgvlDyNqbX+P48HMPLel+ufGz2+Y="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.9_1525285624997_0.023539381523985492"},"_hasShrinkwrap":false},"4.1.10":{"name":"graphql-anywhere","version":"4.1.10","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.12"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"21.1.10","@types/lodash":"4.14.108","@types/node":"8.10.11","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"20.0.4","react":"15.6.2","react-dom":"15.6.2","rollup":"0.58.2","ts-jest":"20.0.14","tslint":"5.9.1","typescript":"2.5.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.10","_npmVersion":"5.8.0","_nodeVersion":"8.11.1","_npmUser":{"name":"benjamn","email":"ben@benjamn.com"},"dist":{"integrity":"sha512-ab1O4mOkjlk+17ye5a7DxUuWafKP8aoH+xmc6SsPNZlrQ7spbArqyLIf2JdbwpzsVLXOyRvQpD6tcc0GtnxBfw==","shasum":"247ada0c8d85b9d5d6b37180973442ac68ff15de","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.10.tgz","fileCount":35,"unpackedSize":143009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa7NarCRA9TVsSAnZWagAAdYgP/0N1Y7fP/2Eqaz4WcTud\nxxHI3Yo166tnBtzcniGyYu60EtK4oZrnMlMAF+ZZFxajDR0ZNH2VpqtHpE87\nN5mFeBL64g0aD9J5lpBgQaUrA4wfKqelKaFNkYwUohaAM+ZCV1LWBgqw8i13\nfP5hXgHnmICGTDdBnpiskLP2aD/Y4dqLLHlYhHc2bJ6fuoY/m9TGX2T3jGWu\nWXOFuiDfQDTSfZj11vuTcmt/dQNQNfxo0W3ZwC1f3yNL848j8gmeqhxBo1eQ\nRegoBAJl0ZoHLgOIQro61APeaERTzRsvDm1bZaDQ6RQs0nHTUjnv8ohxaDus\nnDaOGP9cgFTa873jGf+u379mnEiLHLeOlMFaVjabAGTD59fzqRKlpjmF3WI8\nDmw9xH9FnRA4jssRAq2OBswLPJHbxuZoKXaFVsmsKUVUalTHYoQx68CeyJ/i\n4jgXjSYO9wLJa3DOe33HZu1noMJUvmYCjxtdfSAgLAVHhvb8oIzFl2n/tbvr\nHkCznXjnuZKA6SWHIpWC58aj7GBlQ5U4Ugi4KQFWj1R3VJ+xm8oUewns7xoX\nQnJL2orllxxRIo09+VXk8qaxN0K8LProTq9Q+oJiMYz7Scde1urDeHwpEhKP\nuxSX9+LBpwTn6z+Cg4hqx6g7ZqmHoq4D0XVhRJi8DKxxjLW6J0LrQ4qgYO6/\nRevM\r\n=1GKs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChYNb38tDrssWOR05Jl53XxN4G9W3RyXw4o1nxNXizKQIhAMuFNMv94T4kvggs+ZmId9DZVrkyorcnGWJ3SBpA07/5"}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.10_1525470890735_0.7404025092110185"},"_hasShrinkwrap":false},"4.1.11":{"name":"graphql-anywhere","version":"4.1.11","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.13"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.109","@types/node":"10.1.3","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.59.4","ts-jest":"20.0.14","tslint":"5.10.0","typescript":"2.8.3","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.11","_npmVersion":"6.0.0","_nodeVersion":"8.11.1","_npmUser":{"name":"hwillson","email":"hugh@octonary.com"},"dist":{"integrity":"sha512-zuNsLVcEwJSrv9HaCePPg9AQEte7Z33MqmmY85RawfOC3IGeew/8fHpY+GQQOKpaYvgvwm5fh/msdyuJOCdCig==","shasum":"f91fa82e7e47275260957bb91f2fed5ecd508098","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.11.tgz","fileCount":26,"unpackedSize":101337,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbDgbkCRA9TVsSAnZWagAAL28P/3rIRLB+7AWu2m14bVoa\nPGfvxQRipzBzcmOntnPEGYbFa41FyTJDV0m8g/Vn9303Acdym1lnTwhwQFLx\nTTBLZgb9SIB8sh02Ne01czmfYEK5/8uD7THiwc+xxLE6fUnEu3PNtpMOMlBc\nlxpKb3XXRuOy4EJGazR/BXbzUjeXd4eCgvPvBwsBqVojvhL+2TWiyjtM/ES4\nC5Rk2wTbxawNHNwFtZ0qOumIDWH6X532U1KbigeYFD1J/IBEIj9wjtOHMOYQ\nCbvRrPfEhnEScMBCCf90UrOCtQTqF6l1EqgRfYivdFlYIQt3Q+s18MB1/WDu\n+NIdGkhETR9lAU4tZKjAYhY/S0agpFetGXw+FKgw8JJc6U0j82MLzA9oxvKD\ngimbNKpgf4tcr8wk/WXKmdDxgPaV0t51g2LnQZr4iGRgykg5bFPP09w85jq2\nxAPWbvL+TtUc2fGr4g0j+KE2Bx7G3GLhxMKN3Hf3OQ4PzuMnPH7IOyTzeehy\nG+DOB13oNEQ5RzuOJRUdkErwRhtHiliQ/42hFaFXBHGRRzJlTnYUIBJimC4E\n23TMPDd48LWBQVCWLNdL/k2GS3AH3JqL46T2qHV4jPzSXbb79ot88+Mpz8sR\nljzMhl/95I/IJSROIR6TpWLNm9zNlBUpsIhNbmv7qmGUog4qe2paD33kOmdn\ns0JD\r\n=ZHNP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDF4/oDfzGP/kH9O0t+Wv1/bawAgMdsO4yG2n4Bt7A9ggIgY0J0wYNNW5M3uqWkIZxoCSVjz4aD6yO7I6F+Rnx00kQ="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.11_1527645923049_0.11539271461223732"},"_hasShrinkwrap":false},"4.1.12":{"name":"graphql-anywhere","version":"4.1.12","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.14"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.109","@types/node":"10.1.3","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.59.4","ts-jest":"20.0.14","tslint":"5.10.0","typescript":"2.8.3","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.12","_npmVersion":"6.0.0","_nodeVersion":"8.11.1","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-dBgRKoDNTisX6Pl9ZT3ngE2YP6yHJDncb++As4OOCeFMnD0/KP51kS6xTXig3zEWJGiD7+fnVMTexa+uSSRmTg==","shasum":"1284ecce99d7bf060ad478b50970d9fbc53901d0","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.12.tgz","fileCount":26,"unpackedSize":101368,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbIPOmCRA9TVsSAnZWagAAn4EP/1QZHwo8zVLmt9Oq7wT/\n7uXBgB9HQMPoiA7Iy9AglPEjoT9H6rYnH/XGVgsBqqZfzqpcpfxKmtXxqxwd\nnYQSk42GTnCi5ckniqmkyL9CIgoIAqPoYZ+uVi7GA6ZhM6wM34vnX8ZXPRnw\n0UkRvoPomM5awWYqWAIP0DP1BVkJwYUOlNAXejj//DqCcBbsnzao3VfwnfKo\nSKVOKKyZx7xrE8yixOFNlaqeZ/XUvFk9tjPAYcwnlL6LYqESJcbJqbI6ih68\ni99xgDpORgeur3tFIOU6TfGuseMT0fGJlov2HwTlJyUZ4pcSxfh3shlDTGTu\n5YzLJ6RC5Mpad1ARxAzKhH2vV2dIQBV/S+8aGCpY2+kBajd6Gb2iX2wFMIR3\ncS/ZRSAKd+FleLs2c1s1ah8QQjsUY/pzrXqaLB+rKSDY0x3pTExPN8DeECBK\nUMvcN7CQaJNtMUE7SMSk2hPGtVU/qWnRCsCqWLkWRKCly0vnn31Yd9BAFQNz\nBWpm1yRyYQLDRmxLuhUvsqFfjHznBPK/5vOoRCRBdAzhsluYFfXwC8nfUgia\nRGvifmvKLTgIKgmyR9wWfnl52yPoWibYSH12t2uWTiIV9dSMGDSOmLivl0z/\nblEhWIaGiUUONx2DMr2u2e4DA41PMsnh9pzlqINVWkVUaU2T24wVYVnJqguZ\neO6d\r\n=47Sg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGrBaO3DydNLgeYR4goFCQuG7+/+hSLxuS108eEs1iHpAiB3uw4AtLAbEgnk59OHroSKUJgAZ4H+TIzFjGiYCdZhwg=="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.12_1528886181064_0.8139088563990382"},"_hasShrinkwrap":false},"4.1.13":{"name":"graphql-anywhere","version":"4.1.13","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.15"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.109","@types/node":"10.1.3","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.59.4","ts-jest":"20.0.14","tslint":"5.10.0","typescript":"2.8.3","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.13","_npmVersion":"6.0.0","_nodeVersion":"8.11.1","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-ef7NGkUBEwYeF+aQ/hdyfFgpvGGvkM+2FbW4403FKsi9coj91Bdfbmw9HHKbWxXsEUGYvW3+mYMIke0eIdgIJg==","shasum":"5314b879b0b7066e6835ad2f5716b4dae381dc63","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.13.tgz","fileCount":26,"unpackedSize":101394,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbIc4HCRA9TVsSAnZWagAA9nUP/2Qx5vmVaL7zDZbrTXVo\nHpFLAwUw6Rgo4VQw8NqgHAbpxYNqUephdKZsPfEMlIkyjF+mTED6awWDs65W\n5GSZA71l8M6gdwrjowFl7fY71OkxVWU0/PeXAYi1758W/XtVf3mx2GaCQzXR\n23LbG5XIoKioT4Joh0JJoJxWTrgZu4JARUTDjigCutQ3u2alBmpiTJfez333\nujfTkHdMh0Oj7/Z+eYbnD/Alme0LX8oRhSPVTLSND8JC612Pi/1IVeWPQN2Z\nsHoygQ/WYIv8SduZDRfoCXTTVlW1E2iiFqK+w9/sc9bIXGMo430IfGm1XgJi\n+kYQ39N3cD0bx7+wIcGPhvRnfR2ehTk1OknSOpDJIbrB0Dllo1y9DjWP6laW\n6G9psaiJQGBJITsSmawl7aQom1DyY+pE/qf/1Kn03s6qCZRDRAhKoi09iIEn\nN9qy0Hy/7iml5ynmHnM3ywOcEChRWFaKqh5+8fA7KIr0tJpth2yRGn8zbGnN\nFuFRjm68lSULqMMAd7Z6r45x/Tvu2YyQZRD29N/0qba6Ypcdj9j3h4/i9ScH\ncsSf5trZkokyz3UA+fcy4zESHV4cnvLVdne3FS9gIhKmeL3P6KzsFQ3fnDiu\nrLDSsZ8VD5PMO2vD5q76K7Svwk5l3T9JYHHKhljB+9GnasfvLAO9xSt4wVYW\ns058\r\n=J8yq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuUnZY0oQBWEBFHvd85+aB0IC8U7kUb7qisxbcveDOKgIhAJPorhxljvLc5SZMNa+OqQs5reGTPR0/2NXt3CvgvdRg"}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.13_1528942086889_0.8939685757694793"},"_hasShrinkwrap":false},"4.1.14":{"name":"graphql-anywhere","version":"4.1.14","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.16"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.109","@types/node":"10.1.3","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.59.4","ts-jest":"20.0.14","tslint":"5.10.0","typescript":"2.8.3","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.14","_npmVersion":"6.0.0","_nodeVersion":"8.11.1","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-Wy4h9FWwxgrDRP16wXApP/VmNKXXTvY8jZLDtgxwDuC8Z6LSVkeCDjQSCyNKdgktky104UCbIQ3x+et9bQupDA==","shasum":"89664cb885faaec1cbc66905351fadae8cc85a04","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.14.tgz","fileCount":26,"unpackedSize":101422,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKa1gCRA9TVsSAnZWagAAxwgP/2+2598ZDfBRzX2MnRuc\nTLaCgFWnaVlB8tMx/P+cmVfAq/9enyzpBIq1l2htMza2Hk2YmuDz5rQSupjS\npUL5rdAGH3w1QIvMjLyUfUeezJpZHwwDyB7XCP8TLrWvhIKT6b5qKLymJrFd\nQflSYQJnb8uEHF3rRfMAYrosl/fzZBYjSqYN/abB/LhQa4yNPakEWkROsrET\niyfmCuEggLrtTyXnGU7C2MnOLDeAr6i8rWrImtGvYRXeqXApKZ0IYR1GHofZ\n17P82+gutSqMWJe8xcK2i7du5+Vwb5yMdW3yEm8VG9i16HyGZf9iUbNPqAdk\n1aKeqgVw60mjJvmMAe5ADFYJCSh1sAkL5EbwbK3y7Ne/B+SpWdppAZFv33QH\n38WHPpWQjAHaU/lw90DUwHzT2FGx3pUIJsoms4TZ/zVNmdkkbnjOZVuv04W1\noLMAiQKt2JjJYNII8F2Y3NrOhygFOAt0btzPz7wnH7T/86Lexwx0/sVqyzLH\nocbvChpJYwSm0XYWpCV4zbQ3IK0g/JoGPyCBysspf4TYWkIRBiN2t9Vhf1FH\nykXrceIMFUFK38VtUxFTrNFTThrbnu2MQpYAeID6m9/N8PKKiODqAMfo4ohC\nHTJ8gihv+vKJ+AGg+fnZkUr6xBZ6occ7QTUVa9SYaa9zfV6+TKsccySOsF+P\nRehi\r\n=8MsB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDhLhXA4nBvtW5V+2pr6xP1HPTekFc7Hco3Wy0jlprt5AiEAyKyQ4lRuknoGWL5v2wIO7FqT5D4ar+JSIR2IIpWQAio="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.14_1529458014863_0.6784922485735072"},"_hasShrinkwrap":false},"4.1.15-alpha.1":{"name":"graphql-anywhere","version":"4.1.15-alpha.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.17-alpha.1"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.112","@types/node":"10.5.2","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.62.0","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.15-alpha.1","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-G4kl+B6skvMzR9dC+cAPDwYfWwtjqz60N4CefLmlfr06LM7l2R2a8WW1Qnamn9hVYkEgZUQSDv96RARc70Krqw==","shasum":"b483e9dfcb831562e8ad16ae621a48aac659c0b0","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.15-alpha.1.tgz","fileCount":26,"unpackedSize":102395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbUMqBCRA9TVsSAnZWagAAaz4P+gLLBwVFKPtDqjccLm+3\nI9gE1nWZH1K9s25pGWVvdbEzhQd6O1GLFjbAJOWebf5nX/OEq81AwO7UtrtY\nrUYC5zEZRxb4BRUIdabz61qS/twK7O/NQAQm4FqqssnBkIAoxr2E3DD7pE3U\ny5s842Ovqa2gmza+rPJiVXKek+CnjFdbfoL0H54N1SaOrwZX0OFMCkunvs8+\nCFZFlUMgcgS7+dI1lP8sJan1P9vGJ6SHpCQNf411O03Ouowwj2i/mqqreuhD\nxREvdQdCCTbuOE/M+xjitzFdDh7sJwaKdeX/BX059W+jIWjRqDrzmV9zPCmR\nWLJE0G2r8IaWJZaeZ0v7+694+7Bn3TwBlitTxRfgFROMorSp8FOmyeUgojNx\neHEBzF8+rIR+Aj3X3XD4lyMbdzcYH4Xg+OnHndGfnf4k/IeEF4YXSUSmdK1U\n2T+PjWGsphnQiWLioeuhCbjQvaEu3iec2D2C/Wr4TEytt9NyYQYoPY/kJTdR\nUPe3CZWEfmAeahIFIvuEN5MPsXzitOxMmHMa/mDEU+7unLh6oqjYr6i0UB5m\nTPDxJ8ybub1vR+8rGvyyHiz4+1W6ahEOWOTCu4cTkabK0JuOr2lzZD80aO7F\nNjPjewr/5tM9T/Vnb4uU+yfmBAqb0WMtsTrMpJU2rDkPhnq6nI3Pk4o4LLOA\nsDvd\r\n=ZaHv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2fZeBFQJU/UPWYra9gHBZYKQh+91XjCli0SvC0kChQgIhAN2qlSToNsgAXGCShxgfO7D5BN3fXZ4gEPnd6hIrtp/W"}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.15-alpha.1_1532021377171_0.6647686361158733"},"_hasShrinkwrap":false},"4.1.15-alpha.2":{"name":"graphql-anywhere","version":"4.1.15-alpha.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.17-alpha.2"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.112","@types/node":"10.5.2","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.62.0","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.15-alpha.2","_npmVersion":"6.1.0","_nodeVersion":"10.6.0","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-pecRBOkBkCt7BjKf31zRBXZgLU2G7f7meNRMy5569yKnM7O1WzR1UejFXpmQqte/ReaqzflLzROcThLPl9V1dg==","shasum":"65827f14039e4cf0590f9c162539df9a465cb636","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.15-alpha.2.tgz","fileCount":26,"unpackedSize":102395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVd6hCRA9TVsSAnZWagAA+AkQAJmC8MDKMAq7Q197KaBF\ndl0KI5xTxDryd71zzUAx/rghADLGw1ypxq2fSyIRM0IRecAQm7vxR77J7O0p\n+3M9znTckfj0bAGJcmob5wuCHlrnY5oSpESpgxu9B6hYLmqTUmLAXWJH/KtD\nRI+uozkijbiejD0ZQL/VpFfp/GU+MdpQd5UD2I07MeEz4TdxGCluFyU/GpIF\npj/SEdWrZVWMYL8rgxOsTM/1qSG28Vro5vOLrxvHPZhzzI8rOCw+cOP1uSnn\noupCXuxEuKW8Rdv9Je0qwpRj8U6lx88kO0DNFvEFfY03WoStEOqeNgs5cM/7\nr4BAgWRNYMDH2pRX2uR+zX20O1t/IFVBAAXGlZjZ97q2yeCN1CPkJPI7kWR3\nGU2GbErh8zvNlml+sWpZmm70F5AWbcPQLnQwf8v4Gx0HSm9jaXVSupupu/jK\nJCAHbeOIs1PJ8wl3h/V1hltCRNRR+5BGvKN/wB2sZ2OpcFCogFuHoedN2bVI\n/wgyURJpS9F2FqISUyelpVPRG5gQ9wQOqLTDBpzR8BEBVvI2dX6UhddMl2DH\nRrtZkj9MmlS+r/MVzRFN7gXwq3zMyCzHHOqdxyfdJLz4ML57Syat1v1KEhOb\nB9iTXnYuiy1exhr+MWA4nLXn7RTqNFbt/x6vsxpI95Hr/TexdRBhGsCFRHOA\n/R1y\r\n=XPKp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAfCqN8ElkcJ3s6MPPCieom3O4KrWq7XzIcG72VIwkJUAiAlpE2qEEECcnBU+0eY9OCJ3NtqYjAFYwq5vYUCg8KJTw=="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.15-alpha.2_1532354209716_0.5083633007836901"},"_hasShrinkwrap":false},"4.1.15":{"name":"graphql-anywhere","version":"4.1.15","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.17"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.112","@types/node":"10.5.2","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.63.4","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.15","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-yeGrsMQaGEz7VZTH5gA/easEkDmFkmqudYltYyYdvIXXlsYy5XAUBwaIlahJMKaBaXTfkPUY6Y+0RaPP+P0zvQ==","shasum":"09ac33970e85930aa8682fc3276b76df2637e042","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.15.tgz","fileCount":26,"unpackedSize":102567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbV4BxCRA9TVsSAnZWagAAzMQQAIwf7hyVp1U8e1ypPZO8\nECtot9BjP6of9hGpTOF8pf//h/QfuunMMMnwNpUhkeMfj7f1gFcaUHwmwFoz\ndqzGE4c8IDTD+ocpGqVDLwQ5iyn0GfC3BbhMgNrGB9TzN70IfuGlwjPk7vDz\nkyIG0TPR0dUZDhvyE4F5l/u6D2ir7IQEHOuanqYL1lBKltgBx5izsk2T8G+p\n/aU+XJz6JsINjbYT8Ayxa4IQMTRCHxg75bRKKRgU8ag9KYpScSzuBQYHeqxa\n+BTbJ36qSHretXagmmx8ZItGsC2Qto1mvmAlXl88HN+sygCKV7qNqItvzdLj\n7dSREiTcR4J3N3/LTMQat6+3vY2wwIl6DzogKsK3SweUrocxMxMNDxEGyVeC\n16ESObVWXEJPVdcNLkFqFfAVv+wR17OtCQGlUv/priuLfz3Ki380PrtdjPMC\nP8mQbJo1XxE4E6cNUZrFbLWy0J6wIHie+yodP8o0PxbEnnwtbY1YskMFrYDL\nklVXsIzOYt3QiSuDNeQsUIHRzMmHayH/KH5WaSxQ66hNuN295bdyeo8enfpA\nIBhZQBxnuNp1DemKqPnE40lEiuiufoXH9kI47/FZmpV9644QXPqvavRtGc0Y\nqI/XEyStpFPLkXdiypjm2HaUmx2Nt/AIyesu7WG6Taf6s8PaJ0ccVcdCXaiF\n+zMC\r\n=1TBk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGpykrlORH1oaX5w6V7emXRtMMGB4/KW8edd/v/kAtCnAiAIzbC6P4Qjd+K2nXzXJ7RFcz73AvqWA4ENx306ujUfww=="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.15_1532461161582_0.7149015972264967"},"_hasShrinkwrap":false},"4.1.15-alpha.3":{"name":"graphql-anywhere","version":"4.1.15-alpha.3","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.17-alpha.3"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.112","@types/node":"10.5.2","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.62.0","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.15-alpha.3","_npmVersion":"6.1.0","_nodeVersion":"10.6.0","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-I/Wo/BABKtZ8JVDZuxqX720ktVInflF2+XMdplNd976JAspIjVdq+FAb9KVKncEl3l1Hg3j1QUVpDP7RqIK69A==","shasum":"6f9699a3b073b323d45d3a19e1e7ec1b772d3508","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.15-alpha.3.tgz","fileCount":26,"unpackedSize":102395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbV5nfCRA9TVsSAnZWagAAcuoP/Ro2LDwaT5X0VVGbQ/yb\nz0q/3QxhOBr1SS9UK0EXKXvh73G9VTk0ajBjLExG6yylMVB+wACOf7H3atJ7\nuvumGGWsLhnvC/23WkA0Mh7XBzeXa3ekN1GKleXLxIvUV/ddojpD/Zi5eIR4\noRP9FtWZnWUMu5bpWgHEnBzfzDnLehMLCYtAsskDVYzgbAjS0jAAA6/AL+AY\nT273X5lPHavJTrf4djhLJe2NMTknXdyyNm5jkdZCBcn/OxlVmqbzjqLcuUBy\nyP5FYuuOHSVXIyjhS97La+rzPETBpAOhFUT97BYFtjQHM3af+429xjra1ucT\nvoCrlINfpe6VYnwTo1jqGHPBd4OMRe8SM7+2hJqF0q4W2HbLuhPqloc33Vcv\nWGs2Sr+uHc8HTCqlMPdfeabf38oZMjGjxi5vzgzO7pojmxfstfuDFbHtQDXU\nVWczC8yDe7Et1Qudv4VH4HTanD/sEfWX6v7ukpae9naJ8++uE7Ve75dZAPfl\nHMWA5Ggjtw+v0rPj97SxorK+Zs3BSDJPlV9bmMISp1yR9xnqnOp9KI01Y/Zi\nosabgGNOVHZkKZpjXJ4W4qvHsZ3dYGcKRAKKF31xceWwdKS+owbaGURNNjp+\nbnpBZKNjSvHhasqz+iEzhwd9RSPis7UCcDops0sSWrAIFgMqWr74Q8Ddm5Ga\nc1mx\r\n=bpdC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeNmx86nM/PA2UvWu0+Ogpdd4/cOvcedgm+7ixr+5UbAIhAIBY9QReAmXK3KSJqAgdH9XHL5qCYDYkFogiX6rE9XHW"}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.15-alpha.3_1532467678956_0.5296977927914768"},"_hasShrinkwrap":false},"4.1.15-alpha.4":{"name":"graphql-anywhere","version":"4.1.15-alpha.4","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.17-alpha.4"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.112","@types/node":"10.5.2","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.62.0","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.15-alpha.4","_npmVersion":"6.1.0","_nodeVersion":"10.6.0","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-Uks9ec3RNFaCd/PCTO16etPY9b3dbxf6uY1oZuO4HMq2pHrcub8u/VJ/nJ5wROTKZc61f4Rp/KmcxKltsvd21Q==","shasum":"232e4fcb7a2001d0b485a5b606243e1f8f718bf8","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.15-alpha.4.tgz","fileCount":26,"unpackedSize":102395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbV8ffCRA9TVsSAnZWagAAaBAP/3FUt2TTp/L01cs/BIKe\nxzL//OzKzMNVaGVzUj0jgLqXpeBMkcRxXAqv9ZBDaxkxJDti54kwgO8ParXp\n4Hr35wZ3/30ArYO3aR+tXAUP4cZsFtzuMfyf0M+l6y1/EO+TstHaSIVNXXjj\no2cufMRUunO5l3VmuY9T6KHZYQPZjSwk6+VIM5gQefrOvS04NsrGJ4OYR34O\nxe303voyJHTYLQ3H8LU0uQjvwwVVq/SxRweaKCRQ9L+irRm76zX82NnbF8TF\n3jlSeqxhtLW7eNQhfp4CR79i1pKFviuLeXJbKv9tiKHp+1e3/KVoVH++0CNH\nLQmyA08Q1eMYVVUOpFXGc0z+RgqMgLChoj96HYXRAMp8O/CMp/nJlSmUxdBt\njw1mhWiIGkGRbEE8sdX6gszupJ22qy6in2Mo/fkmTM8s3KBtZvVw13Yf+8DP\nKnyhHlJDth+kigwoQewtC5WiM4ziT+bFj1iWi1/h+1kudc0tagwwcAyuWF7Z\npKx4iLjKTr9hnZFVwCdcEpJ0Hu8LzEGelMt8w6ZK8L4qBCMQMpSYIKFhddl2\n9AP98ZuBOGycn1RfYuxufoKcWQLyxa/NvxNCTu62QG7MAMQGlvc3+HzP4h89\nTyIjjIJ6PZHMRDJliUiXYRJ6BN9z7a2YHe0cs1EdY/JGOpx/z6eo5yjuj+J4\nqZTB\r\n=CEu/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAwnGKyLn5lbsqd7b2X2eEsaFHXVyPenfDGywLiHsJ91AiB61kGGY3KgWunvrt8ZA6Vzc/I0PzyhmaEuJiwCe1+HNA=="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.15-alpha.4_1532479455321_0.6919379752298573"},"_hasShrinkwrap":false},"4.1.15-alpha.5":{"name":"graphql-anywhere","version":"4.1.15-alpha.5","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.17-alpha.5"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.112","@types/node":"10.5.2","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.62.0","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.15-alpha.5","_npmVersion":"6.1.0","_nodeVersion":"10.6.0","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-u41QB4xL/aALGQ08Pe0NJoEf82DLuZ8DOKerY6J6DqVfyiymzsS2Evb4JrSmlzmx8Yo5+23zUR/R8laQ9QrHUA==","shasum":"7261ebccaadd0dd99ab28e961570814a78f5e0b6","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.15-alpha.5.tgz","fileCount":26,"unpackedSize":102395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbV/8mCRA9TVsSAnZWagAAbIkP/23pck4BtNyZYasZIlDV\nMFQ/ljGw+GofLnLRQTuno+Z0LG056dj0XK/EPu+j8w284ec7rxZwwjmJyNGK\nj2rMDEdxaLWCM3uJktIX3RuK/V7PbOj6KQkVJntAffCkZ5HHQsCjYjWIHc1D\npLLuGgyTRgTeGPuey2Y0G0lA5g8mEbiiibihQwEkiMrYfXkT+JeZeSRwLs3y\nm2UWAzyl0dYQXV7dkmHccCE9mSxaklQke4RUR5gdDWwAu0QSbM/IKmE1RSgH\nCxwXpfHJRA+R/DcDSUsoj4+w8qcg8F0HBzvuuF87AWbak+VUfLyovtvgHyJc\nro7/m0RufdXvkbGk36rtRhoDp9FMjni0qA1VjVBF+3X2ngJBduklSxDU3nF6\niol7V4kAO1gJOCMhF/QAoq6+rYtDTBOpwJBHFts4ym2Sj4AGnsfaU+PC4sc4\nXr7BbbNoN41t18cWslxP54bSxLo/OpyDfw4tw/x7vAm8ZUbNFrReu8uz7jkl\n8WjuAun0KP4pDmQfi+BtElson77+bbQspIF6WhEFih9IkWAE30aySAN9dwii\n8d68QKcJdA+ahtE2bjSIYOHKuJHEIf0UCZRVKpmKaHe7OOqGzAWqVb+LlxgU\nOA7hJGL8qPlHg/xBVJKUCJpEVQMVxTmtBbOsGrow8eCkNyaWS/sZw21pVJ1t\n0ODA\r\n=sWed\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHKnVQCOlRIS89301av82vWroQCW/sqtQrIMKePgbivyAiALamdE5kbS/NewH4V6ykkoIy1kj4hSYe8vYUi2mZ/d9g=="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.15-alpha.5_1532493606201_0.7533862027031561"},"_hasShrinkwrap":false},"4.1.15-alpha.6":{"name":"graphql-anywhere","version":"4.1.15-alpha.6","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.17-alpha.6"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.112","@types/node":"10.5.2","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.62.0","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.15-alpha.6","_npmVersion":"6.1.0","_nodeVersion":"10.6.0","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-uH9jwV9YxNeF7wXga0Hv5chYJypKs7FEJCSZnhPY8qpZDVUuVgt3ois1SabjIwgvWg6x3iiyxmKh5AyYfhBiUg==","shasum":"f578cffff985f80e6ebef019e9b39cf3b1e32d61","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.15-alpha.6.tgz","fileCount":26,"unpackedSize":102395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWAjyCRA9TVsSAnZWagAA3rsP/ietFCcZwIxBVR9iqdsi\n2LGKa6XS6cLxumyPtRHV5Fu3/BH1oY1NE0QMVeTs0OZIQWocL5/IRkBmHFww\nVshmqSMzrtr9xJ0Dl0Hg3FFT5zQEGPDfcqSeVJz0WKdpJ95Em5Ag6z3dTupB\nVKtrnH8XdBZ25gpFUDx63G6BlL+NrdN/VvhcxladBK5xadMUJHEG05o+p0XA\npIaOkHiENgvLSYj1AoFRmf3ih0Nu5qEaPplz2uVA1qE8da1R5hw8vHg/sTDk\n7nbpPCiqPJNlXVZeeF4nNcPo1Wbblh8ck0wMX/EJ4ZwAfONWNf+8jYQIRJEd\nH0U5/wj1Q0Ge2FpMSkPA0RUQnWQiBCuynMmfj5bBWTcy4sCB9kejjUsA8E04\nf0S6MiwXwwSrDFJMBWwKb97cf1sMwEEcjQxozm/6f6sRxH8hQEzN12pS9t6w\nIHOCfZjWnlkoWDuZd5HLZ/Giv54uNYpLMyUkdgL2iRZ5dMebHFvpZ95ggG9a\nVfF2vXoPn6Fctnk1iHpLNs7YVlTY1uVLaEmtXy7y8yEV3WH98X757y9AhOxW\ng2rnLdKhy6PVhtYXkhZQcp7sjvmpoEqJSK6yf2LfyE3I9vQkrolpwvwM82iC\nQUkKQ3SSsc5beIPytQ5oNnZAaTuqVgnYToGWxTQ9Pd5xYhGBNr4NoW93KTJw\nZAYM\r\n=QClq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaUsO67vmbjRAYdWZUKXncUp3PO3X4Xa+jtjnESuq/cQIgTXxCz3pkvWczko9BLXJmuq39Zn5qI37JI9b0s+9ZsbM="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.15-alpha.6_1532496114171_0.03144564654990467"},"_hasShrinkwrap":false},"4.1.15-alpha.7":{"name":"graphql-anywhere","version":"4.1.15-alpha.7","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.17-alpha.7"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.112","@types/node":"10.5.2","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.62.0","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.15-alpha.7","_npmVersion":"6.1.0","_nodeVersion":"10.6.0","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-2oYhm/SJ0J4fs9co23PKkAFmV9dDzkT04BtZLBGZ6dMvfLMM+cbyDkJpYONzXhHXHOXOmi69hN0RSUp2N54cTA==","shasum":"4f3464328dc76058625a19535109014b71279aac","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.15-alpha.7.tgz","fileCount":26,"unpackedSize":102395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWAoeCRA9TVsSAnZWagAAGeIQAIHm5prAwjwgahkYmY9J\n2WXXz7Q7dkKZabpleDz9DOGiPoPvHvpQzVB413iaGchFPuh6QrdOZT+w8IQN\nJtOR5ci5KkXnj8aKFMjUu//Zk6f7HClcu1Taw94qCWBtHKE78Qr+tGMxCaqm\nzLmlHkSFFTNC/GtKxTQcNJytz4O9uSRWpYpQyaBRzZpBnxDlW+EWhTCq4+an\n7qyNnLd9EmnY0s3BHTNy0UhzLXNA9aawwSnTH2dY4VhnWzcuPYqssQ4mJv9P\ngARAx0Lrgz6rDtlYoUg95A6qDnEAfI1kQo7rCo4TT9bxTReLIo6D48oi1QXg\nkowX6YB5DVQHWbIrjik1snDEJMGK661I1+Z/TsvfSC6GRFfY3d7e9/KtyF1p\nhjFSiN485bfNlFIqSGWRGA5UH4Vv3kc2QxQNl3dj87VXAzXiwgUbNkKcr45z\nJRUYqe0m1JAayiRcecpk/2gnA90bWlDQYkh2tqi4YNV9R8ahbltcwkLRYrPg\nX16zTxZnIsvMf/rNuAdmmxVdnTIvQ+RLqHraXUmFZrXXROCFQ40yU7XqvqYJ\nlHHQOpysJz4xyeslohwbiu9b9RjV6i/C4+q0s0BRSVYhZkvSe5JWCq/K0VDd\nZStmjOm1bx+VRz40mBmcecZIEpfrg0vmUdKDPLhBBUdrIGnz1XnNfc8DdyZI\ncv4s\r\n=g8+h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1Umo6eHwQ0Lc2VAtbVfPLXvRFF9vTwqDRzej7IOFRVQIhAKzwysWROFvfhSDfYNJkmtWalccvUooFDK9Z4qgIr989"}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.15-alpha.7_1532496414578_0.36159343964153523"},"_hasShrinkwrap":false},"4.1.15-alpha.8":{"name":"graphql-anywhere","version":"4.1.15-alpha.8","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.17-alpha.8"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.112","@types/node":"10.5.2","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.62.0","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.15-alpha.8","_npmVersion":"6.2.0","_nodeVersion":"10.6.0","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-yleWPXYpUidplcjtT6IIZ1feJAUYXaHruTi+hu9W54e9eArOaEq27wo2PcVbZDrU4dbcc0qB4qpIPnU5VgnJBg==","shasum":"89d711a6bd90e2326a2f5550abd4660f015369d9","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.15-alpha.8.tgz","fileCount":26,"unpackedSize":102395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWL6MCRA9TVsSAnZWagAACnEP/11zUo3MMtvRhkmFn0uj\n7b20XsI69AOi0I56ic1+tOwy5879dbarewxN/9gV1ymRAuAxsB7aaKFgghQD\nVJOE5+Rf/QV0a2bpxKtV0FKQkAHMB++ycr47LX013+a3F/0Jr9GZ7Nf1lNyU\nNPlQ+FWG55JGbIlTY7fuWMWQZeC7Dhl0Odd27HW+onHzHoJMDtyMk7pn85he\nRXMbricutcIcJMRFJcQDtpIVdpaSod3wWCPJOiiloyGiHLcrxu6061ZfivBi\nMHT/VCBU3ReULaJDdwqO+rabx0UJ554FtMvs3YbYcLAb1x43GVxuJW3uAvCZ\ndFW74YetIeOCN9jDkgjZIMOqlEEcDWOPt+aBVgeCsgHYg04iWcl+rB2JbEqB\n/uW+FZQy4bfk+HR81aEo03gqso7sJtZoJZqH+6DuIjkF0o1Lh1+jC62VI0rv\nuqwRk2SA2QQWml4FF0V9ukQqfHOW5Wo7up6BTy2Zk1RsR8Y14JqdL7uwOW5I\nuKsmPr8yOrbYSvehc/fuRCovGVc5VENNVReZj/uZVGfwZ9g33nunBDhivfbQ\nkkOw+o+bca17Kd9nAPOt/7mJphrcLkeA2m9Z7fntq7FjMRvsh2FlTEuxUSGc\nxJNbYc9J6tUfA1dlbEgJDPNpZiM1ciuyip82doriejZm1LLTYhFjy0XFqu8/\nGsP/\r\n=kJDF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICajWYw9/qZxt0rS9fGB7opdljdvd105eUrp0h62KbTlAiEArpPICPFWiJq/951TVakynW/8yYEb3n/NypusKvD3wrY="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.15-alpha.8_1532542604126_0.553576587365487"},"_hasShrinkwrap":false},"4.1.15-alpha.9":{"name":"graphql-anywhere","version":"4.1.15-alpha.9","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.17-alpha.9"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.112","@types/node":"10.5.2","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.62.0","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.15-alpha.9","_npmVersion":"6.2.0","_nodeVersion":"10.6.0","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-IY0Qgey2+ByekZTO0E6OKy948cMQvhKbNmdbfMpdXDb+oDnR2bfS/tHlsaAzqQ8w5QcsjEKQpbC1a+mBEOIixg==","shasum":"e3dec9fcb4c18244a0a3deb81e35688691aad4c3","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.15-alpha.9.tgz","fileCount":26,"unpackedSize":102395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWMZgCRA9TVsSAnZWagAAORMP/06n8iiH9tYBA5SMUtug\nSgOYapfM7yimcgPSj+PgkDzPDrhvBvioSW0W7mt2fuxAoTHILBQG9PHUUXnS\nu7srdu9rzL9RslOPBZuNlyWTUAZoVp2an6H9I9+4JRznxwYes9erk2Wv4Xsq\nAjm+B1CmVpkh13oxdbf2pQb3DaRajYyp3+sr9VOmkCVF733OzmbrH9Lgv25o\nUImvmR9LkoEnBgmIe0S5pR+Jd30bXEf775XpAiw7ybgZrmOIy4mLv1iYVTMJ\nyadPlky0rkYcG27s63G/lvarh+yp7oUksE1F5QhZtsQSqvdM2dn1uO1D5NO5\nOIxUptDJ5JUGQHZiGsscMNZ+4JKxX6n9e/fnYOzbPxK9rK2A+Th1YYrCZjNV\nb2czT+N/vXVBkwtsfPiSloqAZ5yYJyFmo0YjnkE7AjY/4lrWw72jqjDf2VqD\ny04jmYLxOQIP1GyVyk+IvM8MQTR1AOvHc+RO+Glc/JIRK3UCL9ebWovntPjF\n5H3e3t9UdgvwbG8MhDoiUd2KWm2x4ksyNfIgTWSAzCEt0eEkGfezp52xpsqO\nVu6b5pLsnqvdjiuxL30SV7/Bcnm2ecHmYF7RAVsstt3TZpH67haEpO6/Rd/9\nIaShniYcNxjXew9NssJEbjNzKwHoNGkKMLCxzaGyJAhiddlN/LB4e/YED5Vg\n2vZ7\r\n=hTDn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICSIjapebbzkQMD5gpgRSCjk6CkdJ1x4WW+wn5QjR51UAiEAs0fnkO4ngNj/tXWtF2g2LzhdRWCJELvxrYlWXV/42sc="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.15-alpha.9_1532544607818_0.6859252503035984"},"_hasShrinkwrap":false},"4.1.15-alpha.10":{"name":"graphql-anywhere","version":"4.1.15-alpha.10","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"1.0.17-alpha.10"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.112","@types/node":"10.5.2","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.62.0","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.15-alpha.10","_npmVersion":"6.2.0","_nodeVersion":"10.6.0","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-Bm/oGFtwOGTyPoVZgW5QkKHvnZQrIn8KsliDPDTHOSWYsL3vpH/Jqy7wSSTG/mWY0xIVFv8DqP3y0vbKGwCKmg==","shasum":"2b3be609a739b37ce6dd8c600a1f1b92eb93f04c","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.15-alpha.10.tgz","fileCount":26,"unpackedSize":102396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWMqPCRA9TVsSAnZWagAAh+UP/1AIk9s+L6plx4fuJpL1\nYPyUzUEle9TR1VpQ2m+Ooz9V72FZsnbTcLj32A/BDuE0p1nHds5czpxv8pVu\nfNiKxqKUjyvdlGNAauA0abZ1ZsInGL8pC/alokY7+jFQQsXah2Rv712NEWkF\nmNTQkTSSq0oroDLjpi+62Zhv9bMUvd+V6GJ18FrRwe++ePGNJwftwQ+kQ/rp\nwmWti2gNyJ04AcukFPEscMpjaFZxd82dN9+IqKWltMk583ZfiMIUPrscWb5F\nEkAFOnsCUc3VzT8SjYgl69PVbZnVra9BCtdm5PP/UM/IO26GOdIbWmojV6q2\ng6BKI6F+6TXQLay48u+B/jE4x2AYNQZaFzHghbbPKDU8bQCUACJauMzXhbK5\nL3LO5bsg9UgvnYFQ2t/quQJLpEIiUkbk16ikX+KKdwG9TX0IrKAWcX2eMP/F\nvoQcqZraWlUdF5n69HUt2LKpL3Ne/ab1E00+AEswWZREmsbPRnBBszwAILN3\nYPFojHR/LmOuOKKBrojTHl+8CebflFfmr7AtLkNxSGZGvrs2RHOMb9gfZ3y4\nFxY8b0TqltZCyGrRuSgX2KFC3GLLSR5q2SdqkbNXpqGpvVBhS6GYNPWYgCa/\n7n9AP0TjQuKyJBFZeTLwANklNMjYcGwdxJ6ek9vCOR9OK+rRCUqn1tXLPdn9\nwxZB\r\n=XyBy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFDZVhxQF4UhCkJwMobELc6zCcLUAzh1ySX2740TcRbMAiEA/cZPYyAdLpq+Rj/JMUl3a2HzDDiA8gTso4NHmRIBKIw="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.15-alpha.10_1532545679261_0.9313667512981099"},"_hasShrinkwrap":false},"4.1.15-alpha.12":{"name":"graphql-anywhere","version":"4.1.15-alpha.12","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"1.0.17-alpha.12"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.112","@types/node":"10.5.2","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.62.0","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.15-alpha.12","_npmVersion":"6.2.0","_nodeVersion":"10.6.0","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-66zorgeWt0g7UvyMaLKDNK6DBYq0fJHn3hOGYPeJUjawh/K69ptLk/TbPSsBkhSCYlj6q5H7gBtB7GMQxEL2Xw==","shasum":"c218898f704998aab0b76c82c707352fa31c6f05","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.15-alpha.12.tgz","fileCount":26,"unpackedSize":102396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWnQVCRA9TVsSAnZWagAA0FEP/iycG30CF0byFavBuxPd\n9p4qz9a7ahXTfBB3hsUmTrA2kjqy+Qh7oX9ij1BqGt8RhkiiPKKWWR/x9LQ+\n+PVvKSun61s++vhZeYV44PIFUykn3aeW9TlbNheLV7vkSKbCelQK+F+e6OQc\nJ0g5EOqTE3zHMxWN5DPoEwUnJf6yGtUtbhwR/i7BPA49u4+S09u182wWai6W\n8TppJ2Qokz6O60afdRk12fcbRLgxuwXdXxmsMwAv78NRcNrNiEkxNGpFF/t0\nEcTDz8JV/kSuc7IHKiuM2s0rfF39H90vvFKrEGzneH4w/dQkVcpXLhK390zK\ntbVMqHT06sS8RCax5LKNci3ddLHLeys41T05xuJ+Q4yf5pRa++CvG0Srlpyl\nDWtI/JqmeSK62nkeA+sZfWE1G8d7QKfwpgHvBJgCkoFsq8aa5rAHNs8vndot\n7flYSmGJozfQMxZEHT+n0DSaMJY6SutUL7gOr8h7ep3ltc+o1XCAbAuhvyQZ\nYdZc/68U4V98hZowiAi7/f7kvBSSx4mP350oXKHUrz61v2dwRnrX7kOQbF6h\ne71zAf2OD+aZan63m8svEDGO7xj7jnbOXwcI10z1F4wjd/UFCXpjHekerDDD\nIFc+SlaWD6lNe1iQDalEyfUQItzOaahTfU4HE7hU59Sw3XcABaOtGvFFd33v\nAyAn\r\n=BLbO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAC3Ca5z3wSKQtkRMDqvsXbw7LLK/bLZxoEj//gOGi4LAiEA0vOsWk8ae7Uq1gt3Jo+w/A78eMXKqAqWRQlz8Ad8JhE="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.15-alpha.12_1532654613097_0.7137077781610097"},"_hasShrinkwrap":false},"4.1.15-alpha.13":{"name":"graphql-anywhere","version":"4.1.15-alpha.13","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"1.0.17-alpha.13"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.112","@types/node":"10.5.2","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.63.4","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.15-alpha.13","_npmVersion":"6.2.0","_nodeVersion":"10.6.0","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-tldfcxMQH1GsVOjtYmACbLSagIun+bC0kBb0HPRsX0OMVccg3eGyzALC+bqFbodgFA83QNNEDbaFqFlMD7yX5w==","shasum":"7deea77590489f488882d5258d367b9847280a31","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.15-alpha.13.tgz","fileCount":26,"unpackedSize":102584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYBhcCRA9TVsSAnZWagAAXmEP/juKaOgqQ1+pgwFde5/z\nP0bTj48f8ZndED9QYNjBC/J8jsMEW65MotbbjlgzqA0k0dBqFVsJYzO54OuD\ncjSEgMdfe0VjJRIdlMiTqgnIJUuydjeEB7waRIqa2IUJDdpKuotcwBQSG490\nSsmR3CyLjRUrJLnBkY2d31GyMme8QMx0R0O87SxxEU1AapdXXNvwEwSyBQGS\nbcd5zLSj2b/cG7j3Q1S8kiMc/r1JoiqDZmW3KyDtyUhpoq3+oaxJzuqh9/sP\nWvgZAaVFJA+bm8wYN6vuJXzdQ1XPm4ePr+fuiv+6T4E4GBshKMX0JDTqZlBS\nCEyB2lqBTOIsxxgVkO8dVjwgoIWhjPG30sjJmz1jBzrAhBRQP99S08tMoZQt\nKxE5hWwYLCc2p/tCiYoIh5Zo5EkTXTBUyogGYorJyieOjAvgNlI9lw82lP47\nN4ii3Z27ezX6ba6uJQAUfNHBjCxxDv+NQJ8mYcWq1lL978m6p80jtkQ7Jl8E\nGtwobCoCJAwTN3ZRefIEWDFJ8Hl0n+Wy94GLuxKDh4L/SBzzSpY8XPCasWza\nIpbtMBPmJ4c39HWkTNMmunITCVh+v/JUOxw9ICvbswD3fekaGD8rreeaRMop\naev5gESQ4TfDDKFOWSk7LQws/NOWUzTYoq9BOPq8UO7GrJYyi20U0TBuCjMj\ne9ks\r\n=oILK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9QYydC7LzRCiMVj+qBIWGdVRSaNbDORBvU0hCPsp0uAIgFkcq7yxW9OV+2kjF4AiMzhTKoqL/uTeqfNN31T73UbY="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.15-alpha.13_1533024347861_0.3631163605206438"},"_hasShrinkwrap":false},"4.1.15-alpha.14":{"name":"graphql-anywhere","version":"4.1.15-alpha.14","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"1.0.17-alpha.14"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.116","@types/node":"10.5.6","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.63.5","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.15-alpha.14","_npmVersion":"6.2.0","_nodeVersion":"10.6.0","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-mLg132oEiEkIBkILNcrQoALmx01nmUolXLI4Xi8sdGHGEmjkqkYS3ut+8gm+FDnKpQlPu+65OyRvKBSPXOZKew==","shasum":"7a531e9875b9888608a998413d20416437544e3a","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.15-alpha.14.tgz","fileCount":26,"unpackedSize":102578,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbalMICRA9TVsSAnZWagAAUNMP/2wy+z3Fs0iVvSom9Bff\nwjV/MnY5c0rKpO1r9jGjxPKIc8MxFt+SYWj3sTQam+1K6PNnae64eq8S+zoN\n4oZXLEtm2XCQ2eCx0y5YhB+zgMEn/r1QBw9fN7gID2Q1xhLQd63u6Ef/JoYt\no6bzVLSxHrpQARjJocLYbPgDxOryNucdKWDwxDHFWlsx7oa8N25DjL8syP/g\niu3t8r9KclmVaGJwl7n1/PPkgWG6dkGLFnTlIyEALSER7RM3dM9Cgbk/mioh\nWjDYWPdi824CTf9D2NR1suLcj67W6AceOmq9+PW+esxpQORyPNpL+aDq8HoX\noqO+pyKkqFNTA3PjSsWc5VVsUnlP4bbPiV9LYhb5hJ7Egg90YzCWZohq3ZiG\nd//K7RC9xh6rIR2dZ1IcYihIw6/4cZAvpMN4zHY5Kh9po8iLHCuxjwXRHQ3X\nOahZbULtc0xf9A5WTv3BfBgpfVH2ycJEq9pxMGTSvVsio7UEEVICbwlbmoOG\nUp0y5yYmuPlNE5OgiaSXHH/dFbcd+bX6I4wNfbzImUJMty3QuquIzPErsLHl\nhq6CPsoDy4Zs0n+m7WP3ROZnFpKLes4ie0rvIMddqcLxw7jd+uw5Fos6NKj9\nUXXSh5jq15zORG2SNaXL+Dn/EBr+SOwwM0LQFUTNRaid1auuXJNrskUnoKOI\nFEUH\r\n=GzaX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBrhCBGeh/JgUvpXw1oiSeoT+ATAHzFpT+Y3cbu1wGY1AiEA07OKjRzRWRvpvWygw/pk12JWhXn+cRPf1Nfp29FGbBU="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.15-alpha.14_1533694728447_0.4321918396963891"},"_hasShrinkwrap":false},"4.1.16":{"name":"graphql-anywhere","version":"4.1.16","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.18"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"22.2.3","@types/lodash":"4.14.116","@types/node":"10.5.7","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.0.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.64.1","ts-jest":"20.0.14","tslint":"5.11.0","typescript":"2.9.2","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.16","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-DNQGxrh2p8w4vQwHIW1Sw65ZDbOr6ktQCeol6itH3LeWy1a3IoZ67jxrhgrHM+Upg8oiazvteSr64VRxJ8n5+g==","shasum":"82bb59643e30183cfb7b485ed4262a7b39d8a6c1","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.16.tgz","fileCount":26,"unpackedSize":102561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbC8uCRA9TVsSAnZWagAAGG8P/0frB0hkMdFKDOtEhcH3\noMDb+Yf3LMB5N+bLXPFEl2pRT2qW5ZcWAdb0DzaLqdAxExdCRd20KTIvioOK\nJS4hzPZ9p2SHD6Ai1xYbx0C0v7iGRWySWkrT7iYL+S6VxlFhGghpdEcNz9f8\nCiE2D+wyco5Xejw+8Zc2GzBGJmol7Wx6LZW/6lni9L9fAx/KWr+H35Z98TAw\nTDyfrHa0dhLugSyY0hFudW19a/NUSoUraRIUZwUjiwXxJUnDqI5edf4dR/Ur\nyIL2UpXuOpuOBv3BwsoVX0JR4leaUwkKhS7zUlhRKQwRNXpq3jlDAySNDYhm\nWGu/Sna/AY0HMQfiYo+hV9iSV5Z5xMOxCN5ZiWMC4QiWf0fC0exoe8Ko8Rgd\nrZ5KqbyAazHko3OEAVMgpkA9RisE1sGF4NvD0x31gwqRgAjZObnPAWdcM2+C\nA09njzUNmrFtK28f4wxBinNUDr/nQO48JSvAz6jPPz/pqUL/7hUW3dNyoEqt\n4V5gpGuGI9jNTylws6T1zx7jno+9UCDl5kvEhwETs0HN0n9n/rmr18Dwmu2s\nWsWW3/jRgzcvuhjPj7/M0awgjAsvQVY+lh1yt7xJ/we8iXSGkjFfH1j59Qyf\nqkKgHTxh/NN7CTpEYtEOm0zqqDr5n0ILs2VDPY49uBZjt8rxa7PeOg7iX5vL\nnOO/\r\n=xJhX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBWOBCN/8nY0XWRsmhi++Qpj25VJCf0eU0fX4vhJaAtJAiAJtFr7Agh16zon8KgqUoJ2FIhGex2cY44bXyHm0u4ftA=="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.16_1533816621950_0.5173722805225398"},"_hasShrinkwrap":false},"4.1.17":{"name":"graphql-anywhere","version":"4.1.17","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"rollup -c rollup.config.js && rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint --type-check -p tsconfig.json src/*.ts","build:browser":"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities && npm run minify:browser","minify:browser":"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js","filesize":"npm run build:browser"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.19"},"devDependencies":{"@types/graphql":"0.12.7","@types/isomorphic-fetch":"0.0.34","@types/jest":"23.3.1","@types/lodash":"4.14.116","@types/node":"10.5.7","@types/react":"16.0.34","@types/react-dom":"16.0.4","browserify":"15.2.0","graphql":"0.13.2","graphql-tag":"2.9.2","jest":"23.5.0","react":"15.6.2","react-dom":"15.6.2","rollup":"0.64.1","ts-jest":"23.1.3","tslint":"5.11.0","typescript":"3.0.1","uglify":"0.1.5"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.17","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-g+6qc83IK+YluKLkdvyp2TymdG3eaIyhLU9a+u7qDN02O6aANELrTd0J+yq/exqDjYEm4ANN38BbO6RxS8fJ3Q==","shasum":"5c9128d0c5c1623dc46ecbdf0916845061f1965a","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.17.tgz","fileCount":29,"unpackedSize":143683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdtUOCRA9TVsSAnZWagAAohEQAJkAD2/7R8lVs0W1eKrK\n0aGpAkFAFSGsrXWHe0fJgrC7iH1QtFNzsp3uASQ4wsqMRHfjcoi273ckhx0L\nBBBdmBWfkcrbHpudCDD4emD1Rs8j5voaLjTn/hc5c3HBlIdKu1m9/d2uWEdK\nUr7DWV6R3KqdO+g1+FVXncHhXFRgfWwISjTRdsXXLuh1dpqQrLJDk/3YpEo2\nW5r+Ng7jNyMfJqDEIwA4NWOVbgQ7k4HgAnHY3aSk1232id8hrUqhrPsSfleA\nXg9ZRKs4CiTFBp/dCm4d2tsr7VHCSkfNMXuZ2Et8lpu0YvPA5WI893tifB23\nVmRVb7iOll9lNRPePNVUCI5vG1UP0UbishRdqze3TRsj5K1n0dSD9YZ3O28z\nZj9AcUP8j3N7Fzphe025KQBlPQegP+HJgaLLWFLo5uIWvxqg0WQIaxJNriwl\nLdHbhTB5clgS6P9ObwSTiUWmO29RXqKCYEyYUc70aG3sO5fDztRQIO322yVE\n09gfEgKgpGnjIPiX4foa2pNhLrkmKPf6rFkaN9s/P0Pka+LfPmIuK6XALCyQ\ndrShBiS10UtbRVqFYbSVYCPJLtrFMXFhXpslMkBJAMI77HJonqW4nzMJfCn9\nM4THo8L2y6w5ydJnqEN1JpaOju85c2S8h3UjgY99+05bPjCgQQXJONWU01Y4\nQQwL\r\n=Pqaw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICSGaPSQ2chnKj7QS/ZE/4YSttGHWlzb2cX2LLnV0HtFAiAmOV8k0ghSes6S8DzWaGoFBIIZveqv+kLIRwPDzZTGMQ=="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.17_1534514445821_0.3466646506472393"},"_hasShrinkwrap":false},"4.2.0-verify.1":{"name":"graphql-anywhere","version":"4.2.0-verify.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.0-verify.1"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"b37faabb6f20de0f5dddbeccbb1a5f3eb608ac68","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-verify.1","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-j4GVzgIg1dQkXl9ImBS+hMr3ME5YypPGbSy6GbaFmkZkhjYV1auYV0OeBRC2nhLZagEmA/Xa/jw/oTxxJJbemw==","shasum":"a3e06fc97fa21072a98a49656784e741fc69a801","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-verify.1.tgz","fileCount":35,"unpackedSize":170689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdvr5CRA9TVsSAnZWagAAedYP/3hXF3cmKFB/SlmvV3EM\nIhGC0HwFxm2WjSHxpQ6AkwTSfZCNkSz0sqLaz037Jishl83S+fpeoOLVgOx6\nJvD7jdQn7jXM6cl/ATZfmSiJhsOrMKhvRahuESQ51fec9DMZWgzlcxkUJrhm\nwccc3Dhxn/U7kIu6F9VV6lxeTC1g3upGf8YvfL0xofaj5E2LjaU1llyGhYpe\n5k145YkQZUZOeEuH6hgoiZ1rd+c7SRT/iK0XedoX0m/IPa7mjorWL4Gc5XPN\nTiDkUhllkCyIBqS59TDtlBdJIsPz4/KD/H8GbqrDhGO/VVkX5/mF8gk1V+jH\nOnAhomFRoqIC1X/Vfsv0o+INORqiggNPIAmK5l/rj2Va0/mOsyUWXkbQf6Q+\nO6aF+B9t79v4Jc9RBc5M2bf93QXLpZP+wAjq9reN72Jn1oxdcXNd4VolBo6G\njsPp/JIdKxxuVlt/hT3naB16SXR6r7RNVdlg7uLP6sV0mKjKrvcmIlMIqsKs\nflrXXipVAHoscNG2XmR+qgGGS0ud0pj2FOgYgCc+WhrmSVZ0lmqOxFPQH3AT\nf85h4U/aGw5QfovsI9A9o9BM+lwoTGzvX6i9y1XrizHvqY1/eDAGZM3uqRpb\nPSVnwpmuNkhrSWl/dibIO4yMsjZyVmcfN/at4hDTuvIyByxKl0M53U+bSoZ2\nXxul\r\n=9h1X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTMn5oImKH+6Ce8/5IGQpRwUfp/l42Lruiu8b4fXNpNAIhAJ5SHmGF+Xwslf8hrK1UcHQ4lTyrA/T8TPqzOVxhKV54"}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-verify.1_1534524152685_0.3758397837934053"},"_hasShrinkwrap":false},"4.2.0-verify.2":{"name":"graphql-anywhere","version":"4.2.0-verify.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.0-verify.2"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"797a82a8b1e3aad73c479ef70dc255282780948d","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-verify.2","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-7fjootaM2uieFeqKsz5GIeowGCqXvQreR1zPoivkIQzqkdUA4evf0B06QGoCC29EL6NNX8adMeyYakTceyGL/A==","shasum":"229a8aa657fc43bd7b3a40b009415d855a0aa4fe","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-verify.2.tgz","fileCount":34,"unpackedSize":141830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdwFXCRA9TVsSAnZWagAA8ngP/RxaC9yrDob5Opxe8sEy\nTxuQBiYtaSCu5iNji7IL2mGYXlLDqaBYkwO8HG6IipqR1Iizn/D8XOwr4pq2\nHljke3CNptF0dDoOULh4xg9u+gDoEG/yigv+lBsvp5B3zcQ0VK3G98L+Rb2P\nCF1Q6M4+Rydm64MntXZefweOGe9CJBvRIzAdT/S728qYH7asQ8BbZzga1a/Z\nyCdJVnc/8NPq8XxlS77relOrjt0nizH1BthtUEh4Uf5OkoVumu3CzAXuNtKw\nAejvPCZjrA+dF73o2to7W7O9hE6DK7nn5R+CngaTvPA+7Y3ukMqmci22fHuo\nurI4ofx4YtVSJHwwZe9vz/0aIamjiaCwLt01/5Ja3jio+IeM5WxlskJ1L+Sx\ntuS89hpfQNrTiEatObu4GsRcLpFuKD6WWhqXb7jZJGMxOKXS135NEJNUXanl\nyED4dWRdk5xkJXg2foCl2QKYm896Zv9JbsdeMNSFZdejGnMtedUJcd/zTvFh\nEOzMuL72n3KE8P4BCd+FiRlzmSenITgpLESOQ7HJZT+KCZsc/7RBZvpMTiVo\nfqmjo+tlw+9fkaHa/z9+o9WHCAFlYDvPF7/V5ryPrWiFyslaBglFVSJafvlz\nQRXvOoyNxZrSYyMK/TcPMH58R9BPCkywOw2aI+Q4MRz+gjXwSLhtYTEs9WMC\n5awl\r\n=5tdC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDx6jqq6euhFSjrwXgh3/xE0MI7dTX/6n+mOC2RIGXpgAIhAPCcNduLvjmNDA99/XHr8T7rP3Y449Xv8N64szFJyGWa"}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-verify.2_1534525782814_0.5475533050866204"},"_hasShrinkwrap":false},"4.2.0-verify.3":{"name":"graphql-anywhere","version":"4.2.0-verify.3","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.0-verify.3"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"4524d36d457da4ea34b8f28048a16b67bffa294c","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-verify.3","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-s55KdRibs/H4Wd2C9Y6MDp7gucsPE7riKqr8BtZdZWgY0eOhoeJnB7OaJvxiiipUfLjb7to6+7jXupz0Tfc4qg==","shasum":"4c047415c092cef2c53c01c56aa9db9fdc43ca34","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-verify.3.tgz","fileCount":34,"unpackedSize":141830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdw/GCRA9TVsSAnZWagAAvGwP/3ZHTLWWU4exKwt9CKuV\nlSH0uQhvsc4YRBjZ4r5jI04mDZ+Q7PHvlBzBh9sPZ8ShKnLTO31BALlmJ1rP\ntbxBkzwcye8RCheueJhSa5hc1acIaI+vSuqwNpodIMWnhpDz4LVrTaM6kriD\n6vxKCPULuu/rgHtkUm0/Q/yjG/dMzTZTl8/hTC0Sjd2gLVTSralYNirfxKcT\ng/RC5L5H2YCF+PIAWiXU5aA1rMiw+So1GWZ90YJ6LDG4bX0i14tsd13AapJN\nOf5+4byH5sT3va5BZWmEgEfD2XNT+hl1h6WF9N7IVksaWJmtHcM6HPt2zxm5\nzzBSlRTT7FjQGMbJGzc6MValj5sItcbSVU3IrbAW94ucJPNuyv9MbTJ6eLxC\n8kJ9e7cmWDhsmT35UOJ/McujU5asSin2cp7EDq5xusOhbhufqO+BTjvi0jyN\neBWesi1Ho+7XG0M4x0ZiJXlEPwIRKhcjWE1+dYFC89PmFEsouDNPWQiDErU0\ncisI9TKp+Pfsw2A+OrMX24XHpPdvTfq8owrLQaAxg1v7v+2uOoO1mXbXS8mx\n7KjwiC9Ip9b5VNxof6885RKfjsPHbn/DnV4vGVQMlAmTGpmqtq0iludRjr3b\nmefpI8QzKb9LIf16Oc40sqaP4lT+4GZKPxKX83E5KqeTg/KuopjRpzX8SSF6\nWf3j\r\n=12RQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC49Q5c40vda9ALdqp+s3j01wfzHPNJBRJchNGOIUcpNAiBhEsEZBSWo9Y8FmUJYqiR2Wd4xnbLRBO6vbCFzK3O47A=="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-verify.3_1534529477777_0.19928708600422818"},"_hasShrinkwrap":false},"4.2.0-verify.4":{"name":"graphql-anywhere","version":"4.2.0-verify.4","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.0-verify.4"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"aa5d083bdc328149e506b275c07d978b3b7fefd9","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-verify.4","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-UbnyPgtknKuiBzNl6qH8FJ4yzIYNh5thjESUPde4L2yOql12HMR8OMLcsBM90aWrTsABg+0lG7x/VLk6TPY33g==","shasum":"243aaa539d2a97264b80e5f4c568e9d3ff62a40b","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-verify.4.tgz","fileCount":34,"unpackedSize":141830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdxdYCRA9TVsSAnZWagAAlnIP/2umrELKisBTuazLuuSU\nV78RXm8X14BdGozXYEA+tOjzWZUkpALA2SiXERuleY04eVBA8KAvXAx7OfHa\neIM+EtaKJhA3CR7idpAjg0PKCnNVBLn/c9bhYnrI2Tt0LBCGhi5Z71Ptswqw\nYpqHJlt5VNY+9mMptv1/Rus1j7BlDoVXQwY2yEoayYMXfwVJ8ASMzDZG5paL\nJLRWqiwxnASyrP9/3BSl1w4jJaxlnuTWHw2HOcEAz+TEoqMZ3S//3EP5c2Rm\nUgq6IzTwxhzwOGuixI1r3cGBF9I0Q1eRqjhZDl5vqxH+bnjICEbje/2rtxUn\nH0yM0sRnDjBgiigVwtOZVhV28Y2ZsDqhIYnzqDtaDEtmHlb1twOBe7k9Ph4O\nmaj13DKfCXnNpBiYNNU66w2leBNMqiev5Ko4vtAF0dN/aIUUY0t98YFxpTDY\ncYqhXVtDyHkiaRaQjyPNS7dX3u5O5U0iUyIyUK9BngNsDkRSQdv57NubOIWU\npq4qX+nDa9CeIR59NO+U619e9ZitpMLZcLzFsi+fFfB/RR11GcI/ihfoytsR\nGZFG4uua6mhGc4FX3MJvvw7CCy1w72A7I1fg86LxzZmGbLnlnIbytkGUrPnn\nKBzFYuJFIkQaLuxmcSgIcAJb896e7pSaaYCdTzDP/Qun6tcCu9Ly+IZXwoBw\nY6FP\r\n=zPeR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFVLiVjI3hPb1pDsTKGCYiJMQ0vlV+WVMyOQr1vh4lQyAiEAzw3IVDYVkp2yKrdCs+S2Sx636TW3MwVwJAEHYug5YbI="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-verify.4_1534531415612_0.39913573211007614"},"_hasShrinkwrap":false},"4.1.18":{"name":"graphql-anywhere","version":"4.1.18","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.20"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"40cccc16db43e190f341794f74e495bd8e390a82","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.18","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-n0jsAEpGpQxsF0RDaxSjtEQdIP3tx2C3q++QuHYFyUl+4Npl5t64zFjWwO3ZhotxmTgs8zaSbZPVFpydn6k0dQ==","shasum":"29bfc5d42bf8ee1f5cdc9a9857c98c3eb4b7fab4","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.18.tgz","fileCount":33,"unpackedSize":139051,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbgtWvCRA9TVsSAnZWagAAXKQP/AobQrTUz0lkro5KLzmk\n8D7g2eVaUotAch1x8TeVnr8NhvJi+TFZm3xFl0K97z9FFX7jl1aKCIFGKrqJ\nSbKXf3vY5MRN1Py9ULDsLWXU2okhkfulvKU+T7kgjHf3rALYxu28GfJyUNpG\nUmNophKBjiSghex/+EzHKUuQ8tpi1bQHoo5yfik3lPEkaHB+PfN/0FjWs5LD\nKDQ6x6jKE8P66/dyRkx/Kdbduyguks9sQjvGU2/mrlgP0owFnoJBPKC7tS6j\nW/3kBCLRGuRij41Oty97pQIofCtKifxVVZfWUYnxCrqdo2hzM1V0ZqNLX+YW\n+FRMe8qkaZp+GryxF3L5uJgTNUVRCVypcJ3cXPOIpL0WTVH6Oxqhjua3uCuk\n5lSW0xOBrrVyl7F52Br1h9FRjvVvXpufTcj97DO8gIPVnmFCqKe4cZd/hPd+\nSlmwKiiO3g3YaiX7XbqkGlhukXpVSyhPHx1t/89RckIwZ5K5c51W4dpmXvdu\nLTDP8eNZryBc3oAK6ajuSMrrLLjKD6wYw0IAxGpwiBLRBeDaSe3ejO2zz6rW\nYl8r28Vz8K/Ae2TbFhkE+lX7Xp4uvtbH5xE187IVt0fVg3AY9J9/5pGpwXue\nyqHUhljUuKYg+DVedceq1bGTK/rIs0bUSXhgG+AGZGeAh3VHY6h7h1/Kd03Q\nJ4q2\r\n=3jaF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAU0kjiS5FUk4V2sem73BLQNxdbeaSU9p65AzIAKyejOAiEAxJuMDIBKiX/J1U5GS79vvXbAH6r5/DT021XXCzZyPUE="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.18_1535301038470_0.8789506227212001"},"_hasShrinkwrap":false},"4.1.19":{"name":"graphql-anywhere","version":"4.1.19","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.21"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"6b8a3651d85c0b9eaa88385caf970905f497cf21","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.19","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-mQlvbECzYPBcgBC9JsdM4v+DSvNmcIP+8Vwr+ij3gktbaLSE0Iza30mztuz40Jlf7ooMs+0emBZucNjLzqz7tA==","shasum":"5f6ca3b58218e5449f4798e3c6d942fcd2fef082","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.19.tgz","fileCount":33,"unpackedSize":139051,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmN6DCRA9TVsSAnZWagAApeAP/27eaRXWFY+FhSj6YkeQ\nZaiQdefrCuupeVTWZm7bL9rjnXDJAYmQ/OPDXQs+dZrItKCM+FAH15ye5q8R\nUJSqh67KE2uvsh8KK4vJ6pTr8TRjGJcTz85Y81YOkkE2IdQKdse581gqbCLw\nH9iR6wxVTW0Al+Dkv+2qzbH/X+4AWOdQU/Eb8ATbOuvohWOTv10Dj/FgWnQV\nJb0JGzMt5BeqbKia0PgUqwEs/it0sdWnhQFSCVbSTfxZl38K3O14tKBIlYGg\nz8vQzs/X8CSjomi/ZPX0FvY+Oz05jM2/vKORzUmrMv3lRYrQdV1eOp/vjfzk\nwxa9eWgAfF7CP/+gtRDCkEQYmfIVgzr/ZOWazsB+qESWbS8XRyB4gEVIA3Df\nlgwugjmngXJI5S2C2qXCYyok3B2Zh22t+Q6dyXLfpjfd6PCsqkeB53JbOw7d\nP3uT2+7kAN5xaFxk0Hdlh0P2Pbir9vMyvONhh0CrZd4Yc8ho80CXM0BRx3Tj\noxJhzw1YWHWGhh8WebDmvSl2lZ9I6Rbg0UM8ZbmkFXcrY6gsPJEPfUETyILa\nf30z8Jg647rQMowcEw7AF3ywrEsCDflTqcX9BJN9pVWrMYp1qD0MgE+W0g5f\nzDfYvQ78/OYj7lylAVbhU+T8EgMSFiWPJF4kUAx4Pm0fEJ9HZPI+gy5wVWvu\nsXQu\r\n=502e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFakqy7n9wNAVxdqzlAIxbkEtBYAkP75n48xx5oV/6f/AiANrTn3xme7s0inOIDZ+e55CduJ79aeh1mPaLZDiwkdLw=="}]},"maintainers":[{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"npm@meteor.com","name":"mdg"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.19_1536745090297_0.5537676342920579"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.0":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.0"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"46323ee30b416809433e8fccffdb933eaa68c99a","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.0.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-91fYc2TrOBIPeRndCWnsHIRWDvQgw0nxexyzopMH5dSwc/Tkim5ZXt39es3+hp5iCnfznpeqbfC3fvEnUJVx7g==","shasum":"11e367fe76ae93c0f83ee17850bb6873eae05153","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.0.tgz","fileCount":33,"unpackedSize":139400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtkzLCRA9TVsSAnZWagAA9I4P+wZohfnzzoSzMf2wnwIP\nhn1ZoxYRFHRlsrCZysOCYrf1V01kkUdb4l8wIcAAdoouqqJd2E+YMfAa0kM9\n6FlY7KyvWADhn5j36qQ1X+H6o+aitsQcrmQUYG0L+aruTW/X/PqAH9TsCH3C\neg2yly0Jd+3v+yozr1bTRlbjHtjOMavvhgHdXvwlAkKh8Qxo/m7MnrsVKyyw\nzt81WN+mKmrhXFjXI4cPDumxHN31M/SeConNLIfG0bNOH8vl96MgYTdkzU1J\nKBOuO46hAxvXVUpjPDc6PjW/P8rSqQRgXYhsgJgl4CuS3CBYKanU3NOOLBdH\nRTfFHZGn26Mrd7/4J/Z/8NI6HhrUsSRBPFCu+5ZoELdJ+8Y5ZKcrM9Na9SQZ\nvjqQ4hDFjasYatY+QSHwVIqEHr++r7fCilkxeHEIXvGzXIfiZ2W/3+SnKYL1\nT+qnwI2DjJOBHFPIvohPjRupZUDli1CtogxXunENhsgQcrzymb/CSzbjeWAL\nq3TUHQ+RUbeNXvzzMmSmtZ0gzWUFTQg3Nf068AaU6GIVSBucKEP7vKBxwRRx\n/YngfZx3cPqbAOHKvcHFYOcJvewGdaPxWtFNmgJ6vK65X17YHUWI6FYf9Cfl\ndsg5Px/0lPE/N31YWQrVpfSPfYcBNDydl3AMrF0cyxsspuOreic4SLm7K78b\nJbhH\r\n=mcgG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4C9GBDCKMRLxEl6hQuRdsWUARNuaGWyd2IGkKhLwW5gIgWdttbhdNFZWxdFQc4wfoL0Vm7VBHv9zA0JQSEP3qsT0="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.0_1538673866866_0.5012984540121896"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.1":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.1"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"492967ff84b67a125dd871e59e5f00ea96fd8bab","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.1.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.1","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-+7JtALOjitVCrTMrFVNYjYIGQs2zA8dW5HV0PvVGGBRQwjkEsulzDnhU4sjIb7StTI349LBphXKXURcqnLZcKA==","shasum":"ee3834552c9fb05c1306d84a7496e4eeae87749f","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.1.tgz","fileCount":33,"unpackedSize":139400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtlBpCRA9TVsSAnZWagAALR0P/0XAtxdCZoG3gKYGjpZg\nWw93M6WV4F4WGAdATBruwLH/34FdUrDvecUpslVI7gbyUZjR1DvxwifZ5d/o\nRboBrAE/ZQQ6Zfz9lQdMAx/graa92P6mPFCu2ahJ1X15O/ZtLiarrqTItGN5\nmcNnwnheu+h7hutAFsROuSZCpJVStAxuC8jaBGZUmBvHolad7DzkcaRZZ2HM\nrTC2xFZD2f18lZq4aTx1txd2VgxUMe8CzqPYoNAhrjBkvWSj7XlaEHccJ2fw\nI0VW+e7CTV5Dt70xJ48ZEdMyPKXbeDkP1/lvAKhrsTMQydbqkbcNRtmzAns6\nlLjkunAh5EKQR+2A3W6DAjxJYd+eCbrqqjAZDZQ5xcBh7xJfzDDmBcmCCLHX\nugQQtyVo5pYqkaavv2I4fms9H/BTSv/ktHy3qeL+txcscXSVvsGILkbRzg5f\nstYlQwL5G/62VAsiHbE8rxDUhGoaaZx0VQBnN2UfUGnkfEKaQJDKS0hfW8sl\nfpK9A+nqv/Iaj6I3vkkJDS/AlMUOQv8TIwXyxDvI5q08CSZ4U7oKS4/hAeKs\nOyRi7O4xhIxM7ckgvbHbG6HoZ5p4N97cpPqeGV60VJ5Z4MT3H/ws9zLMkG7f\nGMmaAmOvW27QPbj2MrnTabdCjPiSN9sLtkZc14QYEWozUh9vh7HHOzBwtgNf\nM4gE\r\n=sm1j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHyzoss3dPtu1i0QrQxHNfCc7UPvLgeaIbmxQQ184EiEAiEAiJhWzwPrj4wAo9l/2k+AR9DNYjegHnirVBDO0x77S2c="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.1_1538674792628_0.30325393601296136"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.2":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.2"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"bdb948ce7d73df51e02efdde8d866c66c5c0930c","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.2.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.2","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-sBew3yxyZcikrXz7HMwtnIxscqWTdJaHUWyVTKzDKktNib4aJN5dX/7iZ3tvYuK/YUbSlU3/JYMidiSepk8YpQ==","shasum":"e716430480da46f8fa5a18d0724f5899111317ef","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.2.tgz","fileCount":33,"unpackedSize":139400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbttDcCRA9TVsSAnZWagAAu+IP/27SO/2Y6uBYpU4lhVJ8\nEglzkw0RqvpnwFyhUZ9ebh4PdXSTCV+CZmZAsnsJZeDRdy8mPNsYdReV/vzg\nfuLR5ZHCp7CTto0SclWw9KcZctqhRv0w5g/gQVCGah3zT0MNEPs9YsBussGQ\nPPPCv9kMV76OMzazfyWfvd80bz0QM8Kuq18ik8PY/cYtzzj9VcGa+isXKMqZ\nQMe58/JomnwksZngXAw+XV3d87VZbiisphfY8j09UnK7Y/Pn49zgtTluKgkw\nQJWLurt9EkDcDgzTEEdZUK2TUzBjv7H/lVdDC+DIjDodVXEbz5wROgO7jfXr\nplrcPCIbdPU3RZo5o+ZBV/37qiIt5JkmHyd55WQU6wihbQCAxHS7uvl/4PEJ\nFj8aPrS6FGgWjNpe7xVqnTFP4WZy4LxIegsRS4yzZMnALPHyJYNsa/h2X/aq\nh8ZuBvCEAdVi6JbxNGSNwpQqXwcpA0050k71Az9aLgeEcjSfd/j8PROfdU1d\n7jb7Vbi+i44G3UcQIsghU4cKlF4NO8hsAKgMZMlLyh6BPZKoE3hDsLU4d2eK\noFCXouzqT7EwnNQ67XBo79ZV6fGTs3Hv09soNIDnmoObRnYlSaLQ7gv0fnJL\nTGNfJWfq93JNFZYW/6IKEWxJ6Kb2KXIJ06+3Mvr13DKaobIa8sm41M6RppVZ\n2VsZ\r\n=qcda\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWUVIoYN62LghslhrOq4bqVRYI07IXTbRAXM7nOd940gIgNWWhrnrCmXZEk8zmQmzRsK4fWUcXWeOl3bpI/2bEoVg="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.2_1538707676077_0.307454233913679"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.3":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.3","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.3"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"c82d181fdda51843bebf97f11c23c46b60a9e8aa","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.3.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.3","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-cOmTk+Pu3IpLoKCIm66Zl0VXClTxuESftA7cDjm9vOn0pk+42UZCdIzrx4rNYwPW9fsqLvPCH6/ge+5Rd1N3/Q==","shasum":"fffadff37e56399683776a370a8c5a0eec6c1b86","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.3.tgz","fileCount":33,"unpackedSize":139400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbt2mnCRA9TVsSAnZWagAAvn8P/i0jMzIcdWGBBvLrlM0Y\nOeDUfmtfzNifeIDeZSA5JjD2cvlbKfzx2l7JEPTF/M/3biP4jIH0ZpwtlT1g\nmLWkEp/KrQbz1oxURMFlReWOwnMoAuRohLuODvMFu1XcetaKcfMHdl7dL5aI\nh93+zmvuu5iUcZt0Gu4T7n1V/MgEQhyGBPkZdLxyYbQfIhdYAEMNah+pAem2\nfVnRL/rAX/zkojMAzDTc4vBoL6dZBkCuprYViG9UX37RjpnzLrB47tXmbGCw\nKKPWW6qgNARxLdSM4s8rANtYfgHMEViskQMGl/b4VE/f8wnTOOnVuqKvMmB4\nV5tqANkRSBsix0ip/S3rWXR5LsO1MOLllwto1vEuj9URC9o24b9tY6lym7Qe\njbQU94wcWSfBUcW4mZOaklGa9noi/D5k6LRTjMI3CzQP/p/t09u007KReqzU\nmuglYaIvj8wzKghv6Wc4V1/iXKzVj2FvapBMqbN2r647KA4Pr459eCfyoPn+\ncS9RCYOUU+XVqjgYio0ZSm37Fhvo0lJfhLvJwg62oZlPno7L0e45rlA3iujR\nX/GB4anjSEHJlsBN81dyfQey3ajNsFe1LvKGTqqbi1Z4qw/iMettxZm9Xu0O\nninZz9EcaC5Nna8CIsmTaWy5qlkhIb9p0FYm+MsQuKWBfqw85ymFbD2MzPZR\nWjKe\r\n=pOhK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhiMCB/7K8gZr9UFOBX0QJfzX/S6nP1qrdGWW35s4uAAIhAJyOx7eqJfxSsaaepQFtWk/yiUzFDfek9clXG5x38TLa"}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.3_1538746790744_0.12965618409297486"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.4":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.4","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.4"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"0e5fe6e6c9551b78b3cdfa180c6a0928bb9244bd","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.4.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.4","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-D+LiaGec4cJfTtDwP2aw85mmCl4OnWMrAAFDwjeJts0f+Rqk7WZNsYHdiuLjt4do3OKWs6/3spxSdu/qnGNF6w==","shasum":"a2416f5432ca617ef6c27e115e88783525b89ca2","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.4.tgz","fileCount":33,"unpackedSize":139400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbt2ygCRA9TVsSAnZWagAAgecQAKIax74EUQXtzaAzTKqZ\n4JXixXMQjU5qahep53hpsFaq1T8ssBysmsCo2i1m8X4qL4hU/NZ4TGnvOyC0\noVUtHY/1ov5uKZSNgLe7XCnwQIF/1m8VWAIkF/FtyRw5+/LP2OyzpszyKI/C\nunDOrSSsFiiiUBcr+DPI7jSejCcEwne7IF2TQqnt/BuUMFTmMI4M2tfNCP09\nqXYEr3YNEATuwHpqB2apSrGpEJvuQuIqm1q1A/MT9h8eEnWt/hMnKh4ckU1b\nzPkGC0XLOIMT1TAXXFIKbKMepOMThR7GEII3GhHPMLy1jT9zC7NUXDG4Y7+x\nCl4YhkAF37put3J4yKDzeTKJx8uD4hBsd5dsjDu0qblhS8RUfF2sfHSXCCGo\n69QYv8UFtzJ4TVeKbM36FNVIQo7R2fNvWJZF6DBQ9KKvh55SQrolw2BNChQU\nYTrMusb6N1EHSxzgNJ6qGiYnjfNI0YNvN5PkXYuOvBEXAZ6tMPRGVLbDrwZw\nXesXANAaCySOsjodQKsTgtnUBKOHJdt/+hEmusUGLRNKInzPnOoLypX4qeo9\n5Z3ZR8KbuQHeqhsUoR9EuRMgxbC+TnghM1zBifTKqvy+B9lbVJXuE8ekZ+KM\nYvhf6bNbrep6T+OQZxZqST4pm72NhIOBbzBfiq2ceQduJwr5Boup1fHAI6oh\n0iJL\r\n=KoZQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBh1odWMfYgy7UyCM8nE8pgJWUZoM+Caidckn8mDH5RjAiEA+iWjmwjXmjoF8/R+37fJLeUCRep95LGCmVaEH/BsYww="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.4_1538747551982_0.4809411897454525"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.5":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.5","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.5"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"212eebf60eb772d5184de25d9fd0a3265703f94d","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.5.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.5","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-vnKcTiolVy5kl+QiX59aIalmqDQjbxX/bboA8k+5kWAqqvVj1o3SRwl+ageSY5+WO+AAe358QprkXjvUQDihCA==","shasum":"4d6e4d8cc4914dd9caf45e1cdf633c644d3e7acf","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.5.tgz","fileCount":31,"unpackedSize":131365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbt7uUCRA9TVsSAnZWagAAbdUP/R/rfJLU1h1Okv5Ldwtd\n9NXnfPXSKJU4w25hdqSUM8JRlFsmSMHJDdVi1s7SvdUDSAAu3Id/nim2yfPO\nayf3XJQK4bsMjiZFL98fpdMDnohxnZnMeVwjz3mYnXLXFKhQvFG8lQvvyUkt\nkkAN8soHhM1FzMd2xfpzzajyNP3x64A7bZUXA5Wur+84VRYLSh3/8trM2DmB\n++IAJ/GLggU0g1Rzqwv0vJKIF2iyltmQB/S1KK2xR9OTKqKqOdXrYSVBlQNC\n7jPY0jfm87xNw8gf3/l7tAz6g10ksKBDNf81Gya20XypgUgSxMcc70jpj79I\nCYiLbWiIaT9HlD0t+X1MpG/6pDYP8UNOIb60s066tenLjFA6oaxVWkD5hVtq\nLkJivt25v01eHUkmJaO5YQjT9I8oj8CFbLOBbaJpcTdZbR5Fp94VP4ICYIwm\nz3baJVVX/0xnGmcUh9/nuMgW2YzMgG2cKa29LupUkGFLGCQoISyj0iE15OmN\neuOy4sDAWhbFrpVa8CwLAVbsPTeEMNJUF4iuyrRgYTJ/3ywFdoc3BQMvYBDA\nitH+5EjQ8QOxvkj1JDbiudUc3p5rnddnFC9NQxmk+K2T60XiJH4q5zI0WMaE\ns+HpGEyy2EnGvMnPoBjhQIuuNkbL/wwM5Z/mPKRx3u4ymcATo0y/fYN6CQGl\nu1cY\r\n=rAbr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBgI5Mw+IPd9g+jcqo7OdQuF/y75Usbdng6YM8TKiBngIgWy8vD66tqkEalp9kgZNoQ6/0bbpHAwidGSHq8qj29/0="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.5_1538767763983_0.26849865574051823"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.6":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.6","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.6"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"20abe0675bf14eb4d87d4001fafa1b42e24564b8","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.6.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.6","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-kNtucR5kC22gXGsOFUum0kDImQgmgntiB6vPN6QFC9VC2LBY9xxm74dEhsP5tLBS8OR09e64jd6DjeIjE3pX+Q==","shasum":"61b028cbc5f2455101af1b483f2251f3dd627d01","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.6.tgz","fileCount":31,"unpackedSize":131365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbuinuCRA9TVsSAnZWagAAwvMQAKQdxiU2ki7u7wce4vTO\npM3A85vfZtEL3moYH6BX5Oed0Ll/KD/f/hN+RGM+7X5ZIwXlvgIcCV5oFX8N\nxDL++u9Nhmee/Okx1HTLpvYvquS8L8hFOtW4/lP2bmYwGIJIzO4fRPHz9oDf\nK9kyx8QCSzYex5SXdFFsyTyH1tOZry85Dx++IYPHRXaQMINs7C3kjjqXOVRP\nBwVGn6FnTuRQxjoDVmnkV1wBzcaHxkBLQMOWj6so6PNZNBCqz6VmGJNVz+1x\nB/jO66XvJiLIWpLxYGwkEOxq3pCOfYICVZTtv90tXvDI4ZfSnXruUrjRECWa\nqj+10JHWmlsB3jOK/6x0CWuxxtdl9XwVr1lzMW2gY71+KgoJSYbLsOIdrfdS\nfIyZAqAZlV5KlHUQBRXQSFG/rWpTkJw9ttnA2I2su4wg37gp0pt6eDOAe5yT\nQyurJz4bXj9sQlJg8wDAenxiq3FfLgkhOt4d+WmxIzm1j6Wn1u2QiCBlLlyK\nMVSCmWZ+objnfIRUPmOh9d3z7z9GdFWcZ6xWxd+7skV03EME6ZuUGz3hTskf\nrjw4UNQJsqdzW2FojxGtASCesNpT93fRXwPJTtBzE7H5rwJV5XiKsPbEISQ0\nEguCOraSGA+9YO6/Sari5kS50vhS1U6jrq5SEweLq3MxuhBHipIoIzhg4lcg\n3O9+\r\n=MnJk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAyjgLCq6ttlZVwPPMjSqX6Cxt83g/T/oxJjMz3SBZerAiEA87YfSHvD+5KixaUtcsqiwENaR4+2n5Z0v6WaVHU379Q="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.6_1538927085296_0.8042057650270642"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.7":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.7","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.7"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"2a872426024b3b647212d4d4ade273efac689a5d","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.7.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.7","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-gw4/MtIzSFvE572VPZhPXRWc24ezqGTL6w/MK3J3rwsjxy9shMpG3JJo5kV3zH59uXjunEBPHEkghdTcMVWQpw==","shasum":"d8ca9b3b1da0963bc6f21dd35b08eed8ca6b6b28","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.7.tgz","fileCount":31,"unpackedSize":131365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvPkeCRA9TVsSAnZWagAA4ygP/2JYFtAOpx3nPmrOGbxW\nb8YA6LxwSZJtVYAcratRI62t52OO8W5Or9Kd1fv/7zud5k5TSuweeDaAaHEY\ncl5FcYxzZF51sTFR7o/GbLUlZzznfBoPRb31hRjL7WUhRUUJP1IziN4ZUerI\nCxO1HHtWxqrxwprWvK4vNCvSFcxrbBgJ4/qNftumiET/IZKiXXJOiol1cW6J\nKRS5TRaZ21cJ3VzBVbi5wQLdFvViqQ+4pgrUy6SESRRhlKke7dIDy4gkvZsy\nIae7hPX9wFR5NulmD/3TPH5QPEwc6vQgdii42ifSXbP+Go98gbHwyrSeS2dU\nPrW+FCHQPKoxUHNu7k1nRiU3bASa9Q0q+2MgaWCJf0fiAeEorMaRrqTZ+GNv\nVYngCEZzp41oYvSexUCdYgapK2BGq7rCKzNuozmFsAOlAMuLaWamouQhvbuq\nWWpxn1ESSi+kxMLXapA5N/C6lm5roXYi0No0acVK6Dx6DGySeoXB5cpOM+xy\nzwJFXFT6GTvtBszHv01zXN0zpXlXp5+p7VJY5Bv6smCrDo9cpWaRsdm6ZQ9u\n5TnCqH2FJNqkWuk3/mqVqa5YBg+ugnuHZJ53US5PppsfAg6yRmHwZ/XR1Ql6\na+tj4D1sgnGRKD9zTVHpkC/GsQmqR7to+8OUUac191y/ym07ATIyedlDOr8r\nRYFF\r\n=1NF5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIETRrvKFYxWWA0hg/lveT60oVsUWlmf+zrrk7QxnY4qEAiBsLXl3uLvS4UgBJJ4JjTeAfADELWPUcMTN9MWK/WmnJg=="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.7_1539111198072_0.3582881098575019"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.8":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.8","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.8"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"f2b76919d190b65c73256220e3331228bb8a8b72","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.8.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.8","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-TAJyiEJOHhp+wMEM2YKip/KipXqCF7CjkBLRVi3FXSd1ujDQiaRWyeoeWwU6kXqvuqb+W3b87RpEeytUHXutlA==","shasum":"cc2aab853119baa387dca80ee8307982ba51990c","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.8.tgz","fileCount":31,"unpackedSize":131365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvRCMCRA9TVsSAnZWagAAfP8P/0CHO9XSnsbmNC14oCTx\nJ8G1JbUB13u3ORFixRJO4dwK2cJLsW1bFmX2dmzCARCQfVe/v5dy5bE1uo1k\nZl/fwb55LNdZrdVR1ojy9i2IkQrfPm7E6NKV/+bRUeaWFboAAVfhuU9XF0Q0\npNyIfyfwdH/LB0T8dKhxGb4Ffl0zqjYN1M6uJMCX31ZMEX6VlCHp0xm/mGET\nZxA/FPaouTBuPWyLRMbxPYwEUjZdyFbdrPDOgWQbESVGHK4wFojqM0ehPyUi\nCWAmKJfgVfOUZaDvaKukmMmSa6/B4ADR39KEb5mwDdMaYa1y05Ws+bobgZ4S\nOgtNiLjdN7uUqdnvr+3DnkxuzhJ4PeS/BLpaszLCIGXXdmmAnw7sAujgAlOo\nwGALgfzyVlC5Risijw2g5WCE5d/aj+D2cu8vJF4foKsBj0xt0jh6GS9I5A1j\nqDZ9aj+P+Xh36PeaonQVWETj2siulzU3s87o+2fjUwyBcLvp7zbQDsSgYhyU\nWrnsyVgdWixAR+aVt4fTGezBl4vOcaUwA7huPMknHK3SVFP979qZG9pSFp8U\nxcF2IlZ84YQU/pTp94Th/6yevccfx8+EWot5zhAz4MorMxJahLsVRyZbj2dv\nUIOn6Ux+wjXOfeSTjpGuHUxC8xYAla4wA0jif6Zyv82IkClUbM8QHdrHYLTp\nZWhq\r\n=azyy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDMNg4mAsCkmL5xrtdGf0BrHNSg6Ps2y8WMGhWDdyFL5AiAB1adK5KlDlmH3Rxz+Q6Q5uzun4bsFGHHpBttaaCSM9A=="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.8_1539117195761_0.4901459093736753"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.9":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.9","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.9"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"bf9299494cdb2bc29e10ebb52dc6276b2e2fc90b","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.9.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.9","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-xd5t1z28zoTsUT+Ozai3Fo7kqIMzJSt9F7om3XJtoDei7a54Bw91qwhoh800e7K/PXVhP6yQ5q+8F4dK5Bs7xg==","shasum":"7de8a97a7ddc346452f267bdf6246ff999fc99fc","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.9.tgz","fileCount":31,"unpackedSize":131365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbyikFCRA9TVsSAnZWagAAKSwQAJPTcE4LO2CLyrxY3t2U\nS48gspIIEBpfpY+2eusUUqyx6UIC/UVDyx9ji83oPj5LfxVWa00ADo4/dF/O\nuwsDIMlXglqNTZ2saIEtIZ2D3r3/OPJMLdlPh5ndPBYIgTr3E38dzM2O7l6H\ne5p76c0UtODztSq6Dbyp29+9clRmHnGDOFF9MIs7Z6sNjAdXwQtlrthYqnJa\n0L2Eao7nQtUF+2F9KXWrEZrUMky5eLHY4toi4GKbTNzXzEZGQr2zO0iY/qBM\ndh90txWUVV5w/85dsMlKv+RKAQSSmauXvuWkKgSgGcve6jiznFsOI7UY6Rmd\nSfdmHcSF6GxmHl0qkVdMyk6nrcQe1VENRf4H7KHH6V92Bj1YFWT6+O6iyyXx\nRR4q800ZzqmK4Ux9x3NaRfGg6Wy0b3wemvp0PjxlmIsiilaNB3DOsb41ZUUN\n/PKOczl13RAaXg3EaHujOYGJK3n6JcNyrzGwYD2xMG8kH6150JjEk99gw5S1\nJrcb6i1t5RtOtfmoMe0oHaUG0czIsJUXXKj+Cofk25Yxe/eHnSYdyB07jHk2\nKkRiob4B/dFOrXHSGyf7Sh64MzLGcAvX4kFxcXRSFyNVXWgdrkJ/TNu8yNbc\ngvD93hRHd15e9I0vohTebHB0Cos5rvGeQK+g9AWXTTYK8vdeQbZxwTlvfOB3\n/1wH\r\n=EHsJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpWoeFJTPYrPfjvim2X21iKk0P++PyYG9AvEN500pECAIgW1KZppBOvZjAA8zQbzV4kjHwwSDrCEzOoI39/s5GrQw="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.9_1539975428107_0.9473955594026604"},"_hasShrinkwrap":false},"4.1.20":{"name":"graphql-anywhere","version":"4.1.20","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"87ac6dc37cf6b3f1b8b8e6d21e46f357b6d8060b","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20.tgz","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20","_npmVersion":"6.4.1","_nodeVersion":"8.11.4","_npmUser":{"name":"benjamn","email":"ben@benjamn.com"},"dist":{"integrity":"sha512-Imz2d2BYsBP7nY1+7wSAtGAPZq16BBoqN6/rSEqjgDRJHLQ+2Tu4ipCldWLgYwoHP8Z/TZdH/sD+fcJ/ulwTEw==","shasum":"636186e89e5f817c4f277b8781fb02d43032d342","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20.tgz","fileCount":33,"unpackedSize":139202,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzlUvCRA9TVsSAnZWagAAdfMP/2JGOZk07JSDk2ERvxSq\nPKHuAhcXc8/MyYK/b9mlP+qNtq197HTILiv8B5liovxCS6ljAs708HgSJuWR\nNRz10yKyVoWNEeZlcfopRtuSJqTSmxb9CBdS3iuqb2ydTCQDzkM7jHBvYB4F\nRtF/bZPvmN0yneW4P+tuN7vwIOR0VZDPAwCl8cfpyXFMa1y34iNC0H6eXDrP\nsKIePYDkVLOemKIxolsumHZwRmX+cD9zVT9WP7UIsYPBThOxZTUCAMCZ12W3\nKbDUyMlogKlRaESewmCuBesV6d00o19lZW1VunTyvr/e1s6kKcYKZQQgMvyP\n3UFw5+jIc6LhDJHdi9dsgIzJRjcQX9gu1+D4makvb1RvoRYu1dm1k4qSEgYh\nG8EdpVZjJ7Yg7b3Zpzo27xWSF3Pr1+PNJnPNU30bJ+zvH90jT+lB+YOfBK5F\n4Dv41Gg32kSNqh2wsNA25efl2dv5oxZ2sHosyiAnBGKNpRpugmLuUsCQI5S+\n+t0rDQjr2uJ2ynKvwO6FAxryq0u9VoAtU+bDxoSzpp1tOF4xzlpIr0ln7A6r\nhyrmSjDlQL75WIb5q6Qwh+0MEF41s7kYNOnDKXbQEW6GAPRPj343QcM846mF\njTZRZ6XPimpiWUX90WbSUa6WIkbVGw0hRdZ4LN5sfcmnxjOkXZPI1yB/+xR0\nP7Yl\r\n=tvlS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaIl07vHJ5F2rGc32H4jPCKZnKMdNNMtuAacrzZJuY1wIgdKxdiXlfBNRyqtfl/XazfjiLvdYMY+qNF8jpgqnWB3k="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20_1540248878374_0.5765554840190819"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.10":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.10","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.10"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"b5daa3bdf3e1bec9e969b7435cfc5ea6d9f159ce","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.10.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.10","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-2Ify1DfIkXBFvK/EfIVFB6j9yWsJBCpbRr5Abm71SuWA+x3nLsawLIg3h20RrLa8M2aDAo15QXYS6yYH3WKsdA==","shasum":"c982f26c79c94c10e7e9093e875cde0a586e15bd","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.10.tgz","fileCount":31,"unpackedSize":131367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzz2hCRA9TVsSAnZWagAA47MP/2TGURwTRh7OOGLFKS7h\n5+YAbPRPhx0BRkRl75Xo2hyybYOyGsvWbjHbszPPa9Q8YSKdptitKKbdJYXF\nuTIs1mUHgaFf0XLW1fYgriUEkW2B2kPNIq2bTHgJk3ksPMxQUY7lDZRgPsae\ncJaGFbi7eN2nHsDaxEevBicukTzNqKy3aTV4QfSKCOjQEIGV2hLTb0Ts3/73\n4FOJoPf33I57Qc4Dc5UdS4eQTxOaljzV33YgxLldVWFxFwG2ztwWO2xIRCsk\nUG96FZBEKaDuipXScOr5vmuXOM04/gZgLd5WaV2JozeCYZoTV/0zxSnt1Ivb\nbicyS3vBwYFpd6QTTJyF9Dp4PlkLYv4oBLlvJ5ni7pnb5FiM8P2HxVLa2i88\nb1sxyMEatAoHBIZwqoOoLZaN4pFUD5+XjMFZL0LDB89a8d/EZ8vifdQ3MnNG\nKTrJCHfl+MqnJrZV2Amak0Y7OVYeP17zqGm9AwWcgvPDrVIYqALQzBo2llj0\nrNzokjb7K3Kz6id1d288cmjl1rJZ5UR257VftjicLubS8Wn++7zQuVwCl+Ex\nn5rNwKeNs5BK++8Pl49mQInivqUTgX9JeuATBG1dyQsp/E4kCG43AzeaMg7b\noErKTU+JwoMvMCJDMASA+dhI7fnivr/ae4tLSWOxyZE57W/ZRLz+/VXH5NBF\nvgGV\r\n=CcFi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEWOZV2BT2aBy3J1AdXm6yt1aAhFxy3kho95DXRxsx7AAiEAxh0VzCipx+4nh2FoExqxA2OlmsWHCYu56Q9pwIhPo2I="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.10_1540308384621_0.07879649848562309"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.11":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.11","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.11"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"9cb985fcb3ae37eb98dfca9211da0d45048b8c1c","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.11.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.11","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-d+QsGtTMvwT3fFGogeYl4Yu7hJmyc49I3sL4lRt3CswgJbvkNTXLufvdItLVvL9U9FDtLqyKb7+pK3uTXDjmOQ==","shasum":"12afa25c54e83de42e4805d2c2c24f32d557e1af","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.11.tgz","fileCount":31,"unpackedSize":131367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0gvlCRA9TVsSAnZWagAArMwP/iqoe7ypjBjr7V1N6WdG\nhAlGmWqu90vS3iI9Uyymy7VY72mgB8LmqSuWEmnWgjlv5sIDogkBAVt4iwz/\nvBj0jzp56Qa/DgiaOIKhtAh4a0wglnS7eQe+7y8+usAz7b1IeWayZvK126Z/\niJ2mU+nAE7HgQqlPPfIz/aQr9r31UjMM3fMrzt9va42Ewm4CnJHFRwUO7ZlR\nG2qHQ9ym1fJ7U8BtO/mv0Ow2RK6TxnCJUV7gfGuWgq5utDh6rh8MKkvv2udG\nqlcbYzP7atK8/FKv15S+WWaoM3kOITJIUPMUF99KwYR1mz7YIogVmjzShVKy\nrGa6xMkwI79VyI2+jh9+YQmX+idyBlX0ScJxE5D8xcW4z495nSPEeoiIf7E2\nSTloSVIADTFyIr24jWhstKdEtouUbHdKq3zVBfrlIkK3UUVs61/NPUYlyIbi\nWqgx/IQHy9mDjZ3eVOanz+On/P5eTRQRlUbTWmo36MautM0z3icx2BekYBdp\nglyJgwcPy+SDFCgyUjSKF4/sDej/H1tGQhikliBqdewnYQqo56UbiZTq0DSa\nbnFL+WXVAjS4YX7gm4dpRyvMSE4fpU7/9QFTmxzzzwchgiacxKCzjbr1Vvzv\nCNij4x0UuhtRvZCqLIEka0PiFFSNEwhFlEhwFrqjfbg89K5r4/eWgyigWGPV\ndYj/\r\n=M6+w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF4c4CXDLYOOS0DV3jQhbc0P6X6vok1y8HbWY3NsvwE9AiBery9yDbJQxBh3+82VXGX9Uh0gGQjqs/lTVXpK3lUNOw=="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.11_1540492261060_0.05558471051336489"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.12":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.12","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.12"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"30aaccf8b9b02340ea0c21b41022802386901dd0","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.12.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.12","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-NgMTHZyvKJPASbnsZLBy86SbHA8RMGcd15C3zU1vdfk0lyuwEBrp1AQdwOmM5qziLKtFoNk+1xENSuGm97+oJA==","shasum":"95d612459525512680dec6e6c971e9d2983f76b1","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.12.tgz","fileCount":31,"unpackedSize":131367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0xGICRA9TVsSAnZWagAA4PEQAIXi+HHI5TqEqlMQJcnO\nAoxDNF5j9098vRECDdrs1+W9W+4UCXcXFBPxy3Gl/77cOe5Me6eq+aeUs24B\nQcT5d+67npeMc8hVPlOh2gqVLxP51qGXZPXbnKJxKQ+k0NRYMcoDlVgBSs4l\nBFACJmu7ufsZ/BxhXHjmyBN8ylWu5J6nXi6Unm/ih0m81dZ1Esx59ZtNQHEG\nW1ABJDag2XUwpHDCDQQcuRR8U4sErHqV4A3bj0VhyAXEF3JBJgLwjJAZ8CRD\n+TGv2PkiBZGA5lsCDcqvcpoRNyF2ql+00eAdAku7SnYjX4VrIzmqWzFzx7Bh\nun9DNf84Jc2t7GR8jJKzKLIGynHjXbtLGtaQknsTLNYn/h6Gtdg8HFLt0eLk\nLKOW18O1pI1u2sGAhDCSFCSjH9VSP3joBmIRU7hwJZi0bAj3u2yuEHqn2Gjn\nggksEW8yViw/luKg/+nc24o8pQzgoEPTDcB5kOJ7ykNzUhAfGHuPv3s3EBp7\nu2FTYrBVW2oitmYx11T8v1NosApVtWKpCAw47EYCSf8CC8vs/yLpEEvBk8kP\nNkbRJCnSA49Bk3zCmbHn5iv9qAvYVLDfJnt1HwQT4Z2auD2HcV3uEcZYs3OJ\nkBkwvcALDgBUY6EJtDSYsqrk0HhZn6u8Ce9VXqhV1rJRCOiBMalyECiQh1ym\nIafa\r\n=PKhF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICKdyI2sFD64bjn5ljbxJFA4JrNIGkUCxqoFR/x2S/AKAiEAznuwBFh5oJMmuqdZidwlsIBgUwexhy6ZU8vEsd+pVkY="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.12_1540559239829_0.5655080701722275"},"_hasShrinkwrap":false},"4.1.21":{"name":"graphql-anywhere","version":"4.1.21","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.24"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"45d1902c7c7948ef6a34184afbf2cf3120e44503","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.21.tgz","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.21","_npmVersion":"6.4.1","_nodeVersion":"8.11.4","_npmUser":{"name":"benjamn","email":"ben@benjamn.com"},"dist":{"integrity":"sha512-1Grw/WGoQUV52VxMFvMu97brfSDKpnHGmSH9U7IbKOJVUcvD0QSO+Exyv/8mjZf/urflmTmneDvCOo8LK4CkvQ==","shasum":"d4d4d5fababe491315d3d310b870437c1f08f8af","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.21.tgz","fileCount":33,"unpackedSize":139202,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb01FSCRA9TVsSAnZWagAAVwEQAJGHe2NjBtiXSutvh1tj\nlEakCpf28AyCl39JS6Qb3i8I5k1OrY2EZL4WM0e9sQ/jgxd1z6JGICzn5kBK\nX3V37ozg03FUcbkWgHNWqjdOHL/eTSHK3G/SDzvGLPjScftBcAoaAnYQzJug\nlDB0tItOfV/oEPomD1dXeb6Vfz8ujA3R8tLGoVSlj7Ps6QhLbAgvKsCnqLwE\nm9UGC/01pJsCeIFN5fyo9aFtyaHK9qBVtxKFanfJfmK4tuJUenurSqItHFjO\n+yF8ReLACO0Aouie6xinaSQhTdxG4SJ3hffCbOpTDG2+5BqpjyF5DRS9/1hG\nbea8Vu1WFLeEP5nDADrVxLYYngO1TmrYAVJcEuF+Ri5UHnqjPknSaMR9hNT2\nySBjfYWapYL0GJhT4lnQP7oY4gaWuj8qkwyin9XVmZzc25ve9XPVZXLNZOz/\nWAv1ZaokCDLdQRU03zMHLrx3qFa+vWCOa9hymVNd2E1ddg6ZBNJ7mxx6Mzyd\nZUvp5UBcX6I5r5s/M7eX36UnTuVJbOqBoxMwB846jJx3eJwuisYtWfHrXTDx\nBfuA43F1i0fdb+8sycJ8UqQDeYQVJoXik5BDA5A6gheNuvojzBu18YYgQ3Pz\nudOh5Ob1lFybn04vOzPzC0AUAR7B8oi2SEIT6jt8ifWH9upQZEsb+Bw9NMnL\nXGdK\r\n=siE1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBhi5n2L+9lBNXuNZe/81u/D657r4ATSOT4T2m2apuhoAiALW5wc2IzKSf7FeA/RyKTp3GJrxkgkc+b//FFBg3QS1A=="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.21_1540575570058_0.1214606120488515"},"_hasShrinkwrap":false},"4.1.22":{"name":"graphql-anywhere","version":"4.1.22","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.25"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"31b0ee4a027c60394cf9297df8f9eeeda3918272","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.22.tgz","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.22","_npmVersion":"6.4.1","_nodeVersion":"8.11.4","_npmUser":{"name":"benjamn","email":"ben@benjamn.com"},"dist":{"integrity":"sha512-qm2/1cKM8nfotxDhm4J0r1znVlK0Yge/yEKt26EVVBgpIhvxjXYFALCGbr7cvfDlvzal1iSPpaYa+8YTtjsxQA==","shasum":"1c831ba3c9e5664a0dd24d10d23a9e9512d92056","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.22.tgz","fileCount":33,"unpackedSize":139202,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2HewCRA9TVsSAnZWagAA6UoP/3tcy1rzk62b9++6t827\neKgMukGjVHkNmn/EGLqOaTEvMXo3S0jK5Cx9B+lNZghIyQLf4hT700ZfIRgv\ngi2Wr+PLmAhPqDSdmPxOCPNGp10ZxJdWCsWrIt7MZwHtbUhcvyksp7PUjRDp\n4G2rvM+7N2WtLCVnmCM+lMmkNkgYlERCrAmw77kmrqvg7Qy34ZNciD51rBf8\nOysxUk9Uy4xg02hA1DKCUPFb9PGe5IwOOR1s3WYPY5eHSyLpi1opB5YF5HU7\nmr/fJBQQjRbcCiD9m3kJ9ou4U0Xw4g30iIIx5qsidK3On0QcbzeeQ7sDtDCn\npDCjUQNz1CL7IUSI24EwE7FutngcN29RPRPVok+HuoiMsOe/IQezE3UZRvPH\n+1Ft/6VpteSx+Bjt+qUCghRPVldXqm796A9Z2TO0LnipbE88shA7haJxrptg\nbJtF4lLJvPt033rpjdN3g9OOtxcVMEl6unRS6Ms2A/r045JwB3kkoo/C7bfX\n8q447Dy2u/J4FbERF2JqmdGe8Ogu9rJzOjTGu62f82vquolon8zxjg4Q5Dgp\n0l3wSHTk8/ayvdrqSnjz2NYOYsz+OsRctQLseFucDkrOkAoqxTSj5dpiXJE0\nX0MK7RAKKKUwxTp54/yRehCNGZPiChUrl+dNajSIYqv+EALry/p7JSrIT1ff\nmZ9E\r\n=9CyD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEPGxqgpQRW19jXXQRlAuZWX4HDbwy+i4hHMD8sgj+3AIgaH8qSHOb1h9SRfvjRXioMOnzaarHanImnAJiebNlBN4="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.22_1540913071742_0.0326402644938677"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.13":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.13","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.13"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"7f2ae57d86e61b38008e56f9aec2ac49f4674a29","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.13.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.13","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-/WVk6865Z8z2Kp1CVbr1clTlerJEJiReE8P+UDHIKmr4TSKO4qkwjcFvOfpb8IfJrTkxcW2sqM5LI0wkHgEdTA==","shasum":"dfdb51fa422fd9b38e7586618642b21b3bde072a","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.13.tgz","fileCount":31,"unpackedSize":131367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4N8oCRA9TVsSAnZWagAADVAP/ilNbzE48qirgzZdqYUi\nnYX9h9CkQh8mej7uCMGnz8jKYZ69n1Fn5B+jjEmufnC3ONpYIipJgK5p2TiH\nOoM5zDDBOfI/AKTQn8r+cYDWdATlHFjmrVo9d6YAGenMQEtrp3ZpFD1f3eYV\npaAZMBcASeIkbijtJ0hOUYWUGsSnyGCW2nkWQjYKVI2jzUt26b0lMUHnCT2+\nYVSMYWoVQuiCedr3S58ELCNDrbPF5uXkAyVgmCboelXQvU8ir5Fum39XAS5z\nTPsxf/BlzXsBIoIPyuaqEUuLCStHymzbb0/KxIIXDsAktn1mE7wjOzHfjQTs\n4fRvIFi0eAfOaoLtFpmRKMUjvPnvrUwAzsjnb0PGU9Uyq89HINhXdf9O7b7o\nrHnWT2NFW933RYKHniwYj5HYmGFidXLC7PcObUJWKgT9sTbG4r86L1zJD++w\nbTn8TjEkWSzeUrrV/BeYtRyH5EQc4VXtP8kxoml6mto7pjc3F7jHSS1iexvK\nZUgR7eDqnVUwCXgSersJyROTil/SBNKa38gZizx2TezN33jPQAxWuURG8LJp\nyoP1QbIowGiQiAX5gqJIDMxPmYMrVQKB6CkOi+L35difAqv9Yi0k8cOufGEI\nt+hDr+gCsDApRktWKfOlAF/HzOk/iaiboj/q8CAvrUQ96VyjvU7bm77cZDiA\nTfMw\r\n=V019\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeB0gC5oolVJ0+ub9OBoSYMGd9IDmBw6QXR/2q52SasgIgf4sj4dFSNhSOfSsKlkZ/cYjpc9nl6rSilBf8zBPtF2E="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.13_1541463847313_0.1540340454190312"},"_hasShrinkwrap":false},"4.1.20-local-state-alpha.14":{"name":"graphql-anywhere","version":"4.1.20-local-state-alpha.14","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.22-local-state-alpha.14"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"312181a01e472dcd68f4857ccf692a737fe7f1e2","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.20-local-state-alpha.14.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.20-local-state-alpha.14","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-tgy+s6HASga3ebnrYf0508khNnCKqh+MUQwn/SyzCQnuVwohFL61mD6JjDJ8xiMY4G0GIb19xAOMU8bNOMRXTQ==","shasum":"5882e67f03e5df413e2c04f6a35db7888615c4d7","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.20-local-state-alpha.14.tgz","fileCount":31,"unpackedSize":131367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4eKUCRA9TVsSAnZWagAA9eEP/28aABl7AeKQCSa+SNUg\nG0KjO/MnTwsAiiLRFgnngSxdBXHIpuhSryG2q/SmKQhgrCt/B+Mx95f6NwCn\n2LQDxfxOtYcEQ6v0AWKufBe3k3BdcoHVX2z6qCn4ucAMDpK5jfh8FtR6Oa2i\nUif260Sxoln4Do0nNWZj/lIcs0M682Rg59JNIrP+rDRcNjMkfnSpYoCEKXcR\nyHc0Es/LfLB7Of1sux3RvKVD4vst9TlODXs76fd/jaUu+2sysFxUgmuHZMa8\n2iX902S7C3ai9OtwpeJpat7V3M/8PLSOYSm/iBjQrbmi5ys4Cu0xzgbA9lnA\nVWUw3tmlLoHRQRypOd0hMVfNkuGTJpUoTxhni7FH6yTtPNnzgBGnASAzINdd\nXKoGX6pqmKf0UhE2ZTfJGsyoirA5vPMol5Jx2Did1YyeVar5kiFbjWAhwYCO\nMJoYCXNC1v7docMlT+vvYYM3bvzxLROLEkyjZbXeH+y1phY99IZAlxuhJJhj\na5xAe2pr7pB+eZElQMtXcMzEtXZSPpf0qyyPtxJmBNw/fGn096D2cN8L8ViG\nAlWF6kKw6CYgFYhghJti0kvKUobp9AI6VcHT4Hp+8Wm2OSlghOMJcXu4aRbb\nFtwaB51tOAlwemig7rYXoVp6606ytNMJSAEPwVfVb9Tk3QS7F6YXn22Byrle\nU4u5\r\n=sEgy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFUJJrMzCXSutB+MUTOhofFf80IFWZnSCGiqN7y9iuwwIgUDgBPlcM6coox/I6AF7mOt1ZwYOnOg556/fhXi/ef+Q="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.20-local-state-alpha.14_1541530259091_0.27816326784268885"},"_hasShrinkwrap":false},"4.2.0-alpha.1":{"name":"graphql-anywhere","version":"4.2.0-alpha.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.0-alpha.1"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"cc787f8f294943fe1f1b8de427ed9a70725744f6","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.2.0-alpha.1.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-alpha.1","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-cnvo9rWsNpkIWoY8V51fyzfimovKwOuou7TwSTLH6QK0W/uTzZykIFIQxhY0vy5dFdvcMGUxxGPAF3Ij7ysSog==","shasum":"bca0219ca424737dceb8846c0b5f150933af64e3","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-alpha.1.tgz","fileCount":31,"unpackedSize":131339,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4iX8CRA9TVsSAnZWagAAW08P/RqwHZAV5Sy8OZyYU/T8\nmF2sjcGSv73TJwMycKmz3e40fIcU/e+iDZdFdaQHLqdEwjDmcIUm0XhFLLrt\nU1sD+bApf3oKlnD8AbKSXX45KHlqMf+7YBngyZHj08TE0nkKYwZ8lDFaz3Mr\nXQyWJhqC35L6IBsgkkGDnWLwXEJkOqod0icncsOSjwVm9V+SPfoqhPPLgEk/\nTn8NLwqr2Nlo+6TC72Knbo9v3y1L7lLhNlqupFXPL+PnbqlX6fOPo2X9JiRU\nhnLs1Ll2ex6D2YvIhd9jZJ6bFoRhnLA/oESEGvVJmqcMaVpOTZobUGu0qlfu\nT5RFwlIlqAVIAIdcBn5Q23KlyUEPIBYUCKrPN4MMmk96TosyKyfRpCUHn+2s\nLCribHDzSRH7SU1Lp0ngu9YF/EG3hB8EvBRLFX+ZtvGEWcZ8kWcBBXRcMtBe\nSOvs3cYHpwv7iXA8i/pqDspCc+AuUhCvmZIfLCK9z3oI46+3Q4zGHgzj6h4t\n5aLDo8mZgNmoIW2eUMMSkUgWNYpcfz3pMDj4DYhyA89lcKegAHU2WHVNW2/a\nx0Rp6yAEDL7UKoXcSyDbWbOb4GGrQvcBqtG+BvHen42xq0effadpsRVxJTJ4\n1bW6zW20+rnZQdYqnkmWIcWS6IYThuWHH8gn9UMN375fbApapdMDShCaOH46\n6OkI\r\n=uH0l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFZ5BY2pPGO+3HuG0KXfKn9eya9YtnU/6VF2b/0b6CWCAiBfMywOT0PozMjK4O1lGi2uOV+8IpJ3jx+uaUnE6Q1ouQ=="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-alpha.1_1541547515807_0.2884685491250747"},"_hasShrinkwrap":false},"4.1.23":{"name":"graphql-anywhere","version":"4.1.23","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.26"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"1da881cce56a1cde8e2fd5eb86e9429f718f09b4","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.23.tgz","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.23","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-8wtmwxWmLzAy52Z4WAw9UiYZ4ViiNXM+2DMOSlg2F7WsVstD0v75uOjCLJQUvbld5kHrgzTxter/THFVkGL+Yw==","shasum":"4275b161432b7c60a36970a1d9840d8c5cc2516e","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.23.tgz","fileCount":33,"unpackedSize":139202,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9aBqCRA9TVsSAnZWagAAKeMP/jHJPzFPuzHhaYKpuZY1\n5tA8HR6HyGUfu3NH2QstWwOmJkbeRDQeXEVT/sI4V1NV/gwRJQ2926PRkPn4\nxfzy0RrqRrOE6pB+wFCJ1isvnamNmmnZ32GPcv2Gdkuc+DgMu0YIc9abZpZR\nxumjNi0idR41SMx/FyMAezQkKvztBUyI1NnurNYu/POGd7OuGzIzaNu184Mv\nCu8GPwnNERmfRYg8/BVORFIzBDRcDkKMeBMbTIxMmqy7UM1d+vf+1KoSwTN2\nMjAtYfZFjRAQB3mYZwIaZpyeYCNhv2QSf7U81kqxk7UZStuo9wMl8iJqmZUk\n2ka3Z10+v3c1UwNV76p4gfpXYcOY68csQuT1P0s763sHcOEl0gQOwAgJV3Yl\nWJkRkvLn7+bjWKDYSZIVkAn0bmP88UO8v8ZB/tvDxYaflZiSlDy9iN0MC4MQ\n8UTvZLgJY1ktfYVEQrZGNN9Ulm05H21fZUTU43/qvPrEqxB8sovUlCtLLhmO\nUc04wl82eQIvPLyBp0Tt+n3xj4ILmlM00/YKIZHgHOwjxTW8lhf07rpXSxK9\nZj2G0ullMCA/SsKOJwoFzta+tkRC8fuoRXMdrVcp/5ABSML3OVR/nYhSJ6+5\nP8W1yMNpUTdyN4iNwm3UkjixzrOvStMnvSY+e4xK53KezLuZTdzS8lbrw+fF\nb0b7\r\n=x5EH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJCqoJAidJCPuZwIp4NCfh64zuqtpKSJsIw4UlTifDxwIgBGj3RbLuKUh5XPtK11izEFKZcd33cCLRdFFoCH+e4gQ="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.23_1542824041334_0.76021593853139"},"_hasShrinkwrap":false},"4.2.0-alpha.2":{"name":"graphql-anywhere","version":"4.2.0-alpha.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js && cp ./lib/graphql-async.d.ts ./lib/async.d.ts","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.0-alpha.2"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"a3e32b0ec42d221d443b402d108b428c53975d05","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.2.0-alpha.2.tgz","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-alpha.2","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-NGQytTi07v1XGS4nZqDYwCOz9qMZTiumQuPFQtpWigGxFcB1ZMqAAkKsf2XrNocod3hlCGOEVjOq4xNobb42pQ==","shasum":"efaed7d8f3306f13cc482a23f509053dd0d92d67","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-alpha.2.tgz","fileCount":34,"unpackedSize":138249,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDxL8CRA9TVsSAnZWagAAYm0P/iuIV6YQOZWVNfGVBPwS\n2DbjNQftPdE66emxiMcvorG6umjrhBqUaFrHiZFduN5fJr0AmvW37zL5MUxd\nmWIA9h/nienEbjybwEFiZJwTcRbUy4mAYUjMxV4aqUXbQp9siY19TtsMuq63\nq1mKdp4J+Ylb6eqwYHBiw9RaXrBdyc3HJaFcaV+2XxRG3YxvT8zSuOfIGRd9\nrq1lsmZOtJmaDbfDf/QPfG3fKxjFLe4sXyV2cf+TLYa4ySMhpp4je2T79qDc\nC0H2O2YUtaV2awIXOifJ7lEp1wH85W1XfhcCyHB/R1WffUikiyWZYxowwDH0\nu0xIFjsSBjlz8bAaG5cYsCiVR/jdomtv40vWk74inQo8G7tdehI95n6B+FTL\nxb23KG3vl7EIPVptFMArzEYkcRJhL+oYV77fPg6pHm6kk3ozg9C2MX7uTZzE\ntc1Sm67rb3hQ7hCZShIgRvWwLSpIH/t+iYmGMbTcH9t4skvyG+Y88WoSQkQt\nXZvM8PACgoHp2EoEWKbYOs6qw96rZjfCUDEYSNHWHCZKyj/Zu5Y2/b4BHhMo\ngcxDj+pIwsE1pA5wo/hgitzAMh2ImL4tMqCLZj7WwySgFryKOWqlPR6yZySN\n4fzvpGTYYH0QJXYqpMNtS1/PlGW5xpGjzr0BonVx4YDQMGVTaTvYy48kmoTT\nGXyp\r\n=ldAX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzvO63kOiYcWw2D8PJWTy+oQs5acClYWWRnnP8FkDKbAIgVUPi049aOOXZs3H0+yzXiLbJ8TDYzVz/N+9n16X8gBY="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-alpha.2_1544491771774_0.03210024545600043"},"_hasShrinkwrap":false},"4.1.24":{"name":"graphql-anywhere","version":"4.1.24","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.0.27"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"4c78a05160c4b0f236eeae99ed7ea4d27c8332e4","_resolved":"","_integrity":"","_from":"file:graphql-anywhere-4.1.24.tgz","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.24","_npmVersion":"6.5.0","_nodeVersion":"8.14.1","_npmUser":{"name":"benjamn","email":"ben@benjamn.com"},"dist":{"integrity":"sha512-g81K7FqXSF3q1iqFWlwiwD+g0SDkPUUa9+Wa+7BOrAe5+7R4BdNWL4dw9BRsJxt0Xx6nOaI2E+VM7QMAucQFvA==","shasum":"59e2a8bfd3d00ac75f6a377e31e4e9fdaa5ce786","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.24.tgz","fileCount":33,"unpackedSize":138536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGp4iCRA9TVsSAnZWagAAzF4QAJRgsOBvqpBJ2plM38gi\nbjv1ukxlNXV7nU84Lf6fUvNpw4qbaS+F8NuAt4eC7heqDtm7vR4ZlE5G10kv\nzb820L63oO5O4Vh3zNwStNkzMvgqLPnt/2aRS9bJ80YsoIpjFbGU1PHjNMJ5\nL1xzB9RpZVIt3whAveOOyNadgWpvD3zNOT6COQ97yKA7R63jjvWTbvPah573\n2lIgze5oKxg6zyhbwWHfcxJWFY4KTjoeRuCniT1ywsvMoSBNlkjxc8TXnkIx\nRURMtx6kTxVbLYlfDGAmfpgAL6eLFoEeiJiogITc3rwi/K+dnc5GxhH8Hu/E\nOtpMzUqECM0/Qm/X5HUpjvQKkHl6XZaTJJzHILzTLEM8crgBIhQguAs2kO5c\nZx+wjHevktAOY8aqPnrZ5RK84tF6RWFSRBEuoTZFDpmNnwFHivVNhYaOTrc8\n3uhUAxgbBsRvYpnxdTlRuOWkGFXoc+nccGZoMdcmon5Ipp/U7Zw9xeg+kd87\n5jo94OgrCO08yr6ZX7Zb0x1lD6tEaa3mg7uqH2/wwLz2Fb6GrPqMVeYwbChb\nqMJflsAxqRiHgTGuzVq9lotet2n/dsxr0ntlv5dEnEdJ9PeFTN3qy3GG/QHh\ntvv++Y8BVrnJXOthL2n8I26s9HENXIgg9bhb5BVbNb3VpbrYZ7txA7t6OXui\nl7SR\r\n=M/AP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICsf9Ik57YbmX11a5stzFm9sYImCQu71BGexGrLRI+RgAiEAhr3DcQEXBE7Q/EsXW9zsG6gbYhTDUT7i+7625fBNWSU="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.24_1545248289677_0.8156430190250239"},"_hasShrinkwrap":false},"4.2.0-alpha.3":{"name":"graphql-anywhere","version":"4.2.0-alpha.3","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js && cp ./lib/graphql-async.d.ts ./lib/async.d.ts","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.0-alpha.3"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"44927d0674e8b06486aa76f325e9e5e6cd2c4887","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-alpha.3","_nodeVersion":"8.12.0","_npmVersion":"lerna/3.8.1/node@v8.12.0+x64 (darwin)","dist":{"integrity":"sha512-9lIpEmErheFHuhV9mrUNSGMoa5AdgVPvuD1knROvbn4yJLwgObMq13bL6vpoV+BvhVxWxCII2r1NDRndyMStVQ==","shasum":"e93931790bdeb9c0fefb662cb028b06f2657071d","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-alpha.3.tgz","fileCount":34,"unpackedSize":137629,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcO+O4CRA9TVsSAnZWagAAiwsP/RuYQdzxfi9CaYQzTDJd\nXz6XSXWFEdytDlmPNvMjLgU+hMZgV1YHxby4fHBrMvKwg12ytZP+tvrtXNl7\n6xVVAG1VDuLKPGrE8ySDd02ZqaDKYd5bmDh4F3jncJbiUCToSqeyBElB8mQw\ntzqLH4Y8EkGLhM7Q88Xlu/5s+1JMUoGB9dTJX8AwQ9E+R3QEUpUh6Q0h5m56\nDN14K5cwkSucy6H3Kka0boRw1nUdbJgU/LP3EgDS4K5u/+DhqWWvh7fvj4Sw\ndqKrvX4SKBSCqw8zT8dRS8yN9QpLWGcKrBKOLBz269QybcR9l2ohRTGnquoZ\n0QRAx2jllqXPSfJpkUPNHTKamCHS9M4D3zHHqD+Unk+pRU571aA581/FaZ+L\ndCD1gPuo1hHKRsMWUJa61XeIwSNUUmmSFzp/skpNNh7Vkin2mNjoGkxQIBKm\npLjdA1F/gB9JJ1kr+fKTYYuu5Pv1Q/9np9SaxQHL78mohJwdAU8ajG+VdPDd\nLSUYM6QLwfRwVmVKYLjfC89d8vaA4UVfClJwtxnhZeXUKkGCU4k5cuV814kz\n5rbc/Qx1XCnn8YeV47VHfeinWDAUj1A1A57Si62GEV5520NziDOwhYg3UJZk\nFxg9KOAaWyBiBwoGcpT0KZpWbmtHCdlyLq/mp3YjwZSFqwIH8j8ytn6QdFJF\n+XeU\r\n=oZ7l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDx3P9szmp+6OttwU6DJbX014xafBw1WTNutDoIzMByVgIgGBQfMGwF4pc234A6kowiUVNs/he2X6ADbbzafG4Im0c="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-alpha.3_1547428791719_0.8280969300336549"},"_hasShrinkwrap":false},"4.2.0-alpha.5":{"name":"graphql-anywhere","version":"4.2.0-alpha.5","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js && cp ./lib/graphql-async.d.ts ./lib/async.d.ts","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.0-alpha.5"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"a6678b338c97aed4772d21e94467b60070cc5982","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-alpha.5","_nodeVersion":"8.12.0","_npmVersion":"lerna/3.8.1/node@v8.12.0+x64 (darwin)","dist":{"integrity":"sha512-D+BPIb6Zmc2MnRSg+HSpztBPLEi0hx3QCDFXCm4bXSEETuw3LxzuBfb/ysx0dYe9N4ddZjKkbCHsF6/9KBWyXg==","shasum":"9398ee3b54c3f6ae860d24eb2ea98df44888013d","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-alpha.5.tgz","fileCount":34,"unpackedSize":137629,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcO+lzCRA9TVsSAnZWagAAQTUQAJg50gJHE9/7mWUbizKG\nCmv9c2rIa2VggL8RRV17aBkFp19HTCZzXCt+c+PPcifOUFPViKuXwAsupvkz\nxUC/O0EXgEyOY1UXpzwXpyT1PKuka2MzaaZuyF/tVQp7qg14ZsiEA0jZm2SS\nrucX3K3LhKzzOVN7VcYlTJUGoUCnZzwb+liLvoRE22QX9gv/hc6iVAlGsZpI\nfsEOAPfiee8NlQc/0aVg/jX1pOmVBcByWTLcjJn5stWQZO3ZgOKh1tU2GTqo\nXPtOAvy5o5vbCDbQ8NX8NGwHYTQQtjaH9I19UZOqMJJsS1BB5HrjELYQEed0\ngNgIrumtoQqoB9Xi0q3soF3+PfFbOBAos+/DDNuS1Yd36TCqKyOeM0D2eM5G\nefLLcO2U0iqidw2fHRfctL4dtoKRX/Cz+YFRCqAuWC0cNt06q8PmdRU74x3F\nVwExT7QEwBVn5P4kSKmZwAFGiL2sMhGGLo+Or0O/YIAoSZfcAS5Xjv4o4Gk6\n/Zfg1mg72WWiNYUSh4WGioarjSFNrhK7wahJOAjUxNZ97ydv5ZrCggzl7+2A\nEs4cIkCuAWdM+hfcM4e9q2flFYkR9D2ue/XUfllBDFEpaVXKe5jM5JBUw4DU\nMKyub8tA3uDY1LU1xBAr1SSHsAVP0OD5L2lXDNtFQkrBfYPeTzlV5B1cjtGg\n3mFI\r\n=EvS/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID/ABuRsuujrRkUe3Et+X23U3EKp7xtDEZ50Jw+xF+9vAiAcT5kD6Cd//Qx6gR9KRJKOKyFMFWj2X4pReumz2d+gwA=="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-alpha.5_1547430258424_0.3929626467089067"},"_hasShrinkwrap":false},"4.2.0-alpha.7":{"name":"graphql-anywhere","version":"4.2.0-alpha.7","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js && cp ./lib/graphql-async.d.ts ./lib/async.d.ts","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.0-alpha.7"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"2d3e19a31d3fb2054980211e5a6d357f7726bcbe","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-alpha.7","_nodeVersion":"8.12.0","_npmVersion":"lerna/3.8.1/node@v8.12.0+x64 (darwin)","dist":{"integrity":"sha512-t/W+PuuBdkko8/j8egY5uaePGhYtUVueyv+v3kTElrAgrB0mBTeDs5CLcdXK9kV4G3iGOdGFTpj+yrmoTtwfQw==","shasum":"0e8d81b2d22f03ff6fc3bb7a14bfbbed42bb0eff","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-alpha.7.tgz","fileCount":34,"unpackedSize":137629,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcO+wqCRA9TVsSAnZWagAAnC0P/1BIJJz9Y2BMpEdRCcwP\n3YW3zYj4DihQId+CCYu3HmuHto/e3IKS19gU1l91ZhJr6JmhIerB/l8V1vb3\nS80m0FG/cC5XURkjQHCG2T6B0zCdzod3L97nbED34t7H0rmmAVF+/tevtrL7\nv4+6jnIaDzgBgMom/Zqk3q63NAfnDr40BgWC1NAq2TtCDOTI1cpuozx35THZ\nkja+7Omv4aBiTRN33RLZwRBMEsxrAGNoUe+EbNLa5UcmDvnrIEkyAvqo4O33\nUeNhwqx0CTcQPTZrk/qRYcgeZZ6/O0nfmfV9pU3zyGa4gSPORcQqqZ/zS6WH\nCJjgfQgT2fMtzpHCJ1QuuA2I2EgZj00loN7n7zESd8TYAYMunmUNjr/H4e3o\nhlqzNRJuaBziXRDCh09tYt3jjaOp06B1Vg29L4+ZmslMmuugR/6EbrqMA9r9\nHkth5G7nWX7KWx4VA/sUgX/luLjmzGx+U5IcK0ieQCjIJHXT8S8herARbxKx\nC4gEJJK77ExYIDqU/v9Yiz6Zs902YGik+RLy9ud4Okxkd1z4RocsiBkE3P1Q\ng8qrK60BXpf1i+9mVJlnW6EzzckxuEC6gtcdRZEj2nQRCE2MdQ/2nWxuPDiu\n9OVK8se1+Z0uqvdC5sELZpSWSQT1o8pLZ7DyNm3DLlNYCrz84daL5tMwxfpZ\nljsy\r\n=9zM0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEze24S3AkE0RwtLuK1bkVdoneu9BQDyzuxjm/4vYOXHAiEApsVOHLTCXLNXO6saVcwzNcJhLIZDYsjeC359BbLI+zQ="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-alpha.7_1547430953063_0.9559832476138101"},"_hasShrinkwrap":false},"4.2.0-alpha.8":{"name":"graphql-anywhere","version":"4.2.0-alpha.8","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js && cp ./lib/graphql-async.d.ts ./lib/async.d.ts","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.0-alpha.9"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"3280afccf6c057a9aa716cc834a2714a03b98da9","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-alpha.8","_nodeVersion":"8.12.0","_npmVersion":"lerna/3.8.1/node@v8.12.0+x64 (darwin)","dist":{"integrity":"sha512-v5mSWys9JL3653VmpmaiExzjabP5F087I7PZqKPeyrxZ0bmabUeOR9YBQ/PaiWI9tvq9RGh6xZk0Z3Ghsz+bNg==","shasum":"b4b40999d3a26183c4ab27fe6453b5b9c9bdc991","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-alpha.8.tgz","fileCount":34,"unpackedSize":137629,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPKAxCRA9TVsSAnZWagAA7joP/32ni/wk1OZa4VWG7yyF\ngNZGewFnfMs77KRnYnaD4+uzXMcJf5bd1U8Yc8n03eovio4YhgfVSq1NJPCm\nYjM33nyYxkvNSOy3AL0SN6+HBWW7YVfevhvZZVein2qm++/Xt7sJFGzuR87f\nhZfl8moRy8VQ7x3xcZfDzREkZShvP0YEAx67GWwe5cctdOK2lsbqOaiEgb84\ngxk3x/Zrp7zMRv/Zvm6/CfbhnfE8hai6xu8gSqRBQsl79T4h2C9tseP6Kpvu\nMmSDYwLB0T9BeIsHmFdCxaq7y5vFhHCSdrPzgi9DxyO14QWMK5ZWPY9GzVkr\nap7WiIW/G4iQfMYubqdGDm29zaLz53U5uOVhiMG5GjwdYTkdFGVyLATChZ3o\nNDuHeGEuqfRfsMZ0oA6YGjMaRIt0mbY3qPmE2vS7xiGBtXYhWmrLdI3Jc5O9\n4TRWLjDcOnlwJVqv8qjdoHA3ZxTbVMeAm6Ah3TXyzBhJnqldUM2ghUqwsh7/\n6B5kp6GguxBzpq3YmGTmTKZmqI8E4bGoAdPJ8PYBJQwwqh/e0DB8ITpBVpih\nIKr8yEygMh5BZuEPYtMqCffYkl9zMP+EqBLqpAF5rE7/WD1MAvd3ut497hEY\nxl9kJXC7HcaUBQMkMABGpLnDhnQ9HIWBys+47KAhdb5LUUg5zXQJnTs9gGFq\ncXf2\r\n=rvU+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFpAMGeAy3nVhH8CyFgN5rye9C+FsXMDFSt3oiE/m87nAiA1Cly2bJvu5yTVEoMF6IeGK5hWgVqKDAzjVDmpnWZx7g=="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-alpha.8_1547477040440_0.47684626586202206"},"_hasShrinkwrap":false},"4.2.0-alpha.9":{"name":"graphql-anywhere","version":"4.2.0-alpha.9","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js && cp ./lib/graphql-async.d.ts ./lib/async.d.ts","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.0-alpha.10"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"51e7d9af321668f188d66bc27aa4122bea96d2be","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-alpha.9","_nodeVersion":"8.12.0","_npmVersion":"lerna/3.8.1/node@v8.12.0+x64 (darwin)","dist":{"integrity":"sha512-F2w16xOUrImuMJPsla2Ln91vtr1v3vGPUfhKEoRu5Kuhw4UQ7fIkiZ0puJj3PkWKUdHmGtVWUE271/1iY9jUuw==","shasum":"1ccf266c75049cae75ff0daa31fcc43a1e7d5923","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-alpha.9.tgz","fileCount":34,"unpackedSize":137630,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPMY1CRA9TVsSAnZWagAAXbUP/2zU8CGrbYjyEuI0xcWX\npkJbqJGa/J9tcX3HSwpwHRYTJdi++0Ox0drT5lUhtvRlRmE+2ZmBV8YJaWVJ\nSMQYiSFmpht+RJGGx/fNE13/i1ILYKhQif9dl4wRvsS/U1BRt2NcSYHRt2we\ni31UKbl66LqoeQhwpR5E0JSpYH9rW5on818cenAOa1RuTV/XfXryd2zRZCL8\nP7237A9KShBAjWOrQeMuWdXHMCUH7p3mkW0sRjU5EhEbEoVzH0wLp+oIvePX\nTUSMTn8ffTXYu4WNEii1y0E1CGEhiEl3ENysYsT9/9Hg1L82MVi6TgipgPsv\njQlyQUB1avnIbNm/DxHkwiHgHI2GGl3XxgA3qiL5zUVA0oAuFPi6rFbnQ6zN\nmDVgviYFQ7G6IMfxZcrVNtLrMQX2eOhh6LPnhdUXkPIHcSBvGx3ZLYy8Wtft\nVf1G/xZMJ1pWQ/I85I/iXSHOYNc903YSAyzHecDDkNBaTDPahUlzQt2/mzmw\nDHDK3GSHhNPSkcYCl42K4T83jowqGj2k/2LmorQNAceyotShgrmwembRYMzy\n0N0oLPZe76szhyMLWeJTSENCkMfCiu2Tl5FukW2s8KeHKzPHPEEiBVv3NS0N\n5LwpUFuxBGWMQB1g5h0LhbfIpjumzK2+sDZxcVzJn/E+3FSyLIIlPbufQFwh\n+iX4\r\n=iWdl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWT1hGeATAmHSg2FRiQf0rW/E8K4C4JdDsuuVpZUaU3AIhAKvGCNqSfAIZr2rPZ80yygamcGyWv6Dco1KhWHGO41Gw"}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-alpha.9_1547486773251_0.27629396750937896"},"_hasShrinkwrap":false},"4.1.25":{"name":"graphql-anywhere","version":"4.1.25","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.0"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"449788f7e2030e41776535fc50efd72b313c2cc7","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.25","_nodeVersion":"8.15.0","_npmVersion":"lerna/3.10.5/node@v8.15.0+x64 (darwin)","_npmUser":{"name":"benjamn","email":"ben@benjamn.com"},"dist":{"integrity":"sha512-6XgTH+3n2R+xhmfFMM37tIUyZPy7Q7/TA4H37m0x6dN/UtsDiGs4jfH1upCIiHc8eKtJ0leyadhFIiXqNB4KzA==","shasum":"fa6be19ddc4ee516a7a197a651f21c6051a13d9f","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.25.tgz","fileCount":34,"unpackedSize":141353,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQOMNCRA9TVsSAnZWagAApzkP/jpeNdwPrtZx+aJdlnp0\nTj66bFDWyBtgmZdOfgB5rrVgdqUave+UOi73VA7fVvVYPDkPW6wTj58+D091\nDD5MEP+nuVavcTCMcxJOPAl9zzCEQEvbmQEZDT2YPWRiY0aV1IZCH7N3GoTP\nhiFrH6zGo6yxVsziCMBkzNZpEgXbx8q/yvfsXU5VIutf8iZd+qb7fYRi3hkb\nVE/L5vYReu1Gc7dv2k1J3rRV8bVlYE3wLbNLnWFf93kdDyOn6megKW96CSHG\n62C8B+yZMwx875lOhpmoqy3sYU+m29BoUVN/bS1fG0FFXSEflv5ovK1OCk47\nG8ec6FPU8dL01tSggSbohL5n0LoL21zllnYz09rBm4Wc15Ybo+L3v4M1mhT+\nykOB9VTa29W/4nrHaK1Nip4ObWuy5xY5vvR+pYFxgBzUILR1rfgKAbHtIRnT\nzvg6DL4Ouhwt3sfb6oT89VlACgXQ2fhSVf0raS76QV67ZpGEYWRMNK1Q5T2C\nBnKsyq2RMEehvXFuHOCB7bCmWQ9Sup9JkvGvn7HU+nLyf9z3TnxoT1WxiM8s\nEqDZmzM2mKo6sFoY/xZfmipnknoTd4EeRZlhuVKjob0c0xJhx9ZPQnKc2ZhM\n4Jk7ivx6c+7BWdO7UMm9ewXN0NFaYzMg0E+EI928vbgFJkyGaU2HsfL1pBTk\n3L1U\r\n=+gOs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIErWXc51mEMNl1Xbix/MM3tKHsQnVusPm1YwZgy07YWGAiEAvRbAAg1pjkMMKysH2IaDfsFZhI4grkyYvelInuSaYAw="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.25_1547756301021_0.995243645577851"},"_hasShrinkwrap":false},"4.1.26":{"name":"graphql-anywhere","version":"4.1.26","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.1"},"jest":{"transform":{".(ts|tsx)":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"],"testURL":"http://localhost"},"gitHead":"decc8fae87249d496608ffa3f46a38b5e635517b","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.26","_nodeVersion":"8.15.0","_npmVersion":"lerna/3.10.5/node@v8.15.0+x64 (darwin)","_npmUser":{"name":"benjamn","email":"ben@benjamn.com"},"dist":{"integrity":"sha512-A8aZ6hrx7dbBP/sgItdp8S0q1V8gvpHXClCL+Kg3AHEwLuqxMG65CVrrBUuoVHDa2mW/WRxEw4IjL1fRnTVJEQ==","shasum":"efff57d8dfcaa92de637e45d93ac0a4adcb71185","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.26.tgz","fileCount":34,"unpackedSize":153545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQgwWCRA9TVsSAnZWagAA38QP/1LuL6mopr7tuqlsb8Hz\nHlIqL2fWTnEPuyLY2mBgC4dmhEgxROCehv4Mr01r7+xljSFItA98OGqaJPR/\n96Z732OPdthjghEX9rpD0RzODwHhsrMiL2jMG1o+aKi7rmeQdK3iVjCr0qXR\nEnWRxvsvf96v0cARSFO/ug4bgk9dItBZcESodbhKulFdhjrA/AWmGESFkiym\nYo9mYWbXZsNXzm26513EClBBcmyncWcAK58UHmPVqyAg1UekzhIIZVo6fis0\nmKfCOW5vZEaI/Vj72wnR4cUWyR/xmbxWqiI2gQFHxf4X/e8irjVCsYZpyGh7\nlW+iKEXhwwalsMUPEro7qV15AkpCJHCGcBVx0sVDmGBwn7q7g+Y+JK8EJcq1\nYphN9QF6o7Tb6Dp9jp1zZxWOKrrMlSSilzt0EP2avrVEWQpFe6V6SwdO+vA3\nlb2/nJHPHi2bfYUS4cRWzvy9JpZAAfoFom9aujeDtXFf92zUjhFxdOXoLR65\n1voNqf0C8hZx4jidddMBCg2UU16CxYyltSGBMKnQECoiaSta5nhx9r5VzbYf\nW3qjz24E5eAjAFlXcwgJBlPKjxIrNeI9hAV/RdBKgsXCc273YNxLo/6YBhxq\nT5md7+LlCWGQEYThCqu9ftFI+4XrTKarMLrh6LC6/kmlqvtMCSmry9ST/gD5\n9oTO\r\n=vyJ0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3JnQECQ7E+gn8tO0lcI71/b2s/NkYasPI42tdsRvowwIhAMe7V2HfwU2EZ4EG9an1zQnBs894atLl1+0SxEDTbpJx"}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.26_1547832341331_0.6616493236230665"},"_hasShrinkwrap":false},"4.1.27":{"name":"graphql-anywhere","version":"4.1.27","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.2","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":"42a474ce983964a3eb3fc4b1e5d90ebacffeb739","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.27","_nodeVersion":"8.15.0","_npmVersion":"lerna/3.10.5/node@v8.15.0+x64 (darwin)","_npmUser":{"name":"benjamn","email":"ben@benjamn.com"},"dist":{"integrity":"sha512-ErASfs9siEMrmroHU0V4heh6cIdA8K/SoYpahJFgEM6YDAwUZuycTAKIrMaK8XJI37sHZWcujF/ySuYnIkP5vw==","shasum":"7d013b4c51039ea6c46839a53abe924f8fffd4f3","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.27.tgz","fileCount":34,"unpackedSize":153562,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQlCDCRA9TVsSAnZWagAAsyoP/1IVhJn/8ASpEMTyRVdy\nfSmsPbQag6SG3M5RNyNZnBOrodP5MP23pFKOs9UOtZYgkaoX81xLMhUqQ/L/\nSH10Jdu+9k5PMCM9hMuc+LZqHNxErE7ZaZyicbC/hbgO4ob/3E0joceliQ8t\nqw54UgvNCN+f7hxnEg03M/S/YKlh6AuQliRZGBUU9euMQebUkRc/Omi86X5v\n2SmERPBJlMDOh2hztYipvlqi8zY7OLh+MEsa+B+bHZxb3NsdBLBjgEOihUMU\n4v8lcdXR29P4fx2ri8de7BDpGuAq7tsQsXc1vSBkx0JvQYPXQhgOHd4k38ly\nlZQqOBu+7Ihb9Krc9RE0CyiN//C6OLVeskaxNIXllXn64zTxL7WpkEibzIhR\nP4sHp6jEb0nS/nKyF8KgH++GNU2/4729xJcc129ePfcw6VE/+oSkyOmYA79z\nwe93Jb9iakdW6ZIKovSpV9wpfk/WSwANKL/dSfah6qagvAo/ShmlfHgftdK5\n68P844Pnjl4WkQw7ZUNfkxQ5TPn/Vtwk0LvSZam03CgpckPKUe/pIIq0UM+T\n+2gBS8eRyfW+Yv9edFFjmXEMd99L/UgZBTj9/iAziINiuXUNN5KLJhwYqZCO\n97sXwoHqKixd90jUgfImbgpIoCwf2HiDGIjRiyc6KZD3yZ/q8tLsigQH6XTH\nCe48\r\n=GvQ0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFbY3bJvbVHEnqqELCq+Ukl4cFs2MExfI5JQAc9ArqlVAiBhPVTy9Ee/iCfUD8e1QeaYPSNCc+VFIZDIyI7ax1Znfg=="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.27_1547849859014_0.8656341513703516"},"_hasShrinkwrap":false},"4.2.0-beta.0":{"name":"graphql-anywhere","version":"4.2.0-beta.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js && cp ./lib/graphql-async.d.ts ./lib/async.d.ts","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.2.0-beta.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":"b49a7e851b5637eb9bf3784781fd2c8881a2d2d8","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-beta.0","_nodeVersion":"8.12.0","_npmVersion":"lerna/3.10.7/node@v8.12.0+x64 (darwin)","dist":{"integrity":"sha512-bSSbCDhwRy9KaxpEFWLgIvKOFTk9ptF8xGZe33LaNINNKfdwrBSRnglpB2irfNjrc5YSFMbRiOsmPVMtu7Uahw==","shasum":"e5f7a74b411512b463ce37ca8f52fecbd0888a99","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-beta.0.tgz","fileCount":34,"unpackedSize":151193,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVIBTCRA9TVsSAnZWagAAsegP/1NHMoyRn5joiZvaNcXV\nZ50oroyRHWEryd4+WyUJK5+yxDjIrMeWzWygAPUzMnckGvTOJxDW2akzCHa2\nM3dTf5hJUNYjXCvdlFHU1D9ha7oFfj6rJCHmcTb7+aaYH/xBUCpybXFUzSc4\nnmLEzWi7aKuxuC2mU0S++HnzPW7jRS7RFbZULV03ArKNSq0YH+QmCJyC3Z6+\nkW2Y3pLRoggUy99CTGiMGsMzc8aVQSiCmoMEfgs2UgEcoEQC+psPGBB650Ye\nJ31QLT1BYS4YzbQ30Wp9Hn7BeYd99+Aswa9rESc7NLBmWnAY6gw3LBOLwr+0\ngSUdDVElgxb1nUo510zDvSzoVuLpxI8JkxkReckOfMavFYP20DqNBpr/ZWDz\nZEjpmNncuSa2wlXNjcsLcjBj9yPJVsTEE1amIPRdmWrqrzwYvgBd8V2+bCao\nARzxVqMDILop9OnsVyV6GGYWnbad1Z1Wqce41frw3Z7ASm8NjkdB+x0V9z0S\nqPWD4lhWeT31xvL3imZRCMzZ9iWqGIK7Yy8wI5vYUAyq46HLcBoshZqQCoRj\nhFtxXB4kVBlqC+Y3XGNSIVNds/Ylv3+wvT3G9Z+U+t2K84YcHzBEwA7qzrlV\nuzfhvhwCwG6MOmmAuYyRKSPNiVK2sk2MZP9Ewp+Gc/H53fqH7Bzmpea0qkAV\n9Jj5\r\n=M6Od\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDvxWOe4RJxTQkXh2hRhGFIaYnVPihkSKgSqysiJLDIHAiEAsDN3dmUEJVmTfzFT6Ggej667z10luHibACqm0TGXSys="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-beta.0_1549041746326_0.963395152810405"},"_hasShrinkwrap":false},"4.2.0-beta.1":{"name":"graphql-anywhere","version":"4.2.0-beta.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.2.0-beta.1","tslib":"^1.9.3"},"gitHead":"ada6057dc4a30ec07b7e8ef2f68e9372e16e1e12","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-beta.1","_nodeVersion":"8.12.0","_npmVersion":"lerna/3.10.8/node@v8.12.0+x64 (darwin)","dist":{"integrity":"sha512-d31mwsEXPJtGM6fW2vRoymthRCBow4qYVmqpAsY6eEClTBBmG3804Y3c2Dm98z2UM4NhiGbej1Jx0kvPWWOh+g==","shasum":"6cb37e599cdb1cc1237d9aa92e10511e8b30a0ce","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-beta.1.tgz","fileCount":44,"unpackedSize":218875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXIW8CRA9TVsSAnZWagAAJRMP/jalpxU7UhyDzoOmufTM\nB2amC30CMRE6+SsIKpH7hZwSyuXVsV0oaDmbGGoDGsjTiq4QCyIq8m52j3jQ\n8qvhW0FTywMa/iF5NGcGuhjfa83nY3ppuoGQQ+bX/7eFuddVm+IWzg0XiUwN\nBvDEPRehH2rcJaUMjfbiFzlYFXghWcpaSzs2Z8d6YFUiiXopOwLPZ6BqUE6v\nD+4kxuXwtRoRTNBiO1u7EBpnCkISX0IY7HN6GvxTLLYTSXJ7aKDdIssJ/7z9\nWtyx2tzedul6hU3QaN9mdpeknIJxPfwbiJlKY6ku6e5JCnjNY6AaRHrkEu1h\nS1qjxHU6vGK3EAvL+a9Aa3tvPYMxdJA0n6YxqgMs1uYY60auqg8LnL3bkiXf\nVEOHR+vkR+Y/ZL0/mwDfpAHw3JreTa1hPWu9+NU/Q5Kf8bXaFFthuVCr1/MW\nCx8zGo/mnNdMOLu5sAcA7zRYlk3LqVS6hD/BxwN+FDKqrvI6pmpmt6QvOUqa\naoYDPqaCtTcF+OvlWmrJ3ffvaTRMO8i/R7m6JMNigNDDGHdWjK6VZHLlQQOG\niyYzDIklV/uvUzOqZoB5YS6Q9iOq7bmz7YR+1Z/Ly77xpbOpodNNC8nyHi9U\nlMJAWOK6CBE6esDGuk6nReMAR/gBwonlGy1O26IciolSfjvscXuqwh6aYorv\nQHkL\r\n=8tDM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGvaYlNtd0XuSpWDb3R5myQsl31+lTXno5A9SR6R2qYwIgJ8FocuQB+VUb70FSwqqolwspkqmCME6AqKrqfXqGBrM="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-beta.1_1549567419407_0.03486175242928802"},"_hasShrinkwrap":false},"4.1.28":{"name":"graphql-anywhere","version":"4.1.28","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.umd.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"jest","build":"tsc","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js && ../../node_modules/rollup/bin/rollup -c rollup.async.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","minify":"../../node_modules/uglify-js/bin/uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.umd.js","filesize":"npm run minify","clean":"rm -rf coverage/* && rm -rf lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.1.3","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":"5217dba186279b20f540f2c01dd773a101a34608","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.1.28","_nodeVersion":"8.15.0","_npmVersion":"lerna/3.11.1/node@v8.15.0+x64 (darwin)","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-NtLN0qmu2AasvZ31kwWte1UOw1mYRbfuSICbcVTshA2S5/BNZ7IVMl0X4wA2HPHc3mxN6rvrU4rS3+/Is2QsVw==","shasum":"532ced541ca9f463030e14d3a7ede5b7282a12a8","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.28.tgz","fileCount":47,"unpackedSize":263564,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZFz4CRA9TVsSAnZWagAAIg8P/A2ZgYrZhJ8HuHYsQc+5\nsD1b3/FoUP4PMe6SF+B9YEX/P8FGth3DYAnpoSUudcuOKYJM+qgX2bvpjERU\nA9dipoELGa2xRSM2Gd6sXZJ1F6N/o0OglivN2fuv4gh5/Vk7si5qeRnmWMSE\ncWVxYSFfb8WD74DzSbFDyX+IJcEJBbf1g69gLZqxvVJJK+eNSLLA+MH8/AtJ\nI12bctn8ySGVCD+6f3yiWfJuLtOhzt5EUgRnIplwpIhd/Ab+Jhftidf9fdzB\nprnkU3Fxhfm5uULR2WDLHZxU1J7jGsvlDtCB66qhKKrvjiXO8fiEQsdsgzz0\n4oQ47o65DTjgIlv+QuYGe2iNxQ332i66rrLLF6Z6kaeRbSnmbV8PC9p3bfs1\nCrGQ1E/1wWEIBjo/IKEKxZQYU5EoMj3KvHf1DA3QVvfkwFsrH2O7R/EMr3iU\nkNNxCnNKqnj6dwK8F2byqwO15cTcONTA7iQWnhhflonFnBlaaAWrRoggZb/q\nIjfupcqWC78NLtqmRkBtVyd4BnfJ5Yw8jBSDHl+ZCxeLaGu8mQaX1lPlqZWk\neGYAOkOGBQ2smvO8JwPzbMD5Gv4wks2CNg3XKQ9I1+0X95W54tLo+gg+6++k\nlj6Ye/l2MISTp1+mk5Q+YF/rIHZ2vA4o23llW+5kTRbvTY78y6LwkLNVnUkC\nMuAj\r\n=uzI7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDk0UTv7XW8h2PNyRIar4K4uHn7nBykNAol96skYa+WqAIgMeKX+dBGJcIhq80AnzkM1eA2vSWuIUXz6/+8iDcLf2s="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.1.28_1550081271810_0.2999223714947341"},"_hasShrinkwrap":false},"4.2.0-rc.0":{"name":"graphql-anywhere","version":"4.2.0-rc.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.2.0-beta.1","tslib":"^1.9.3"},"gitHead":"d6b456687202ec2f0ae3ffd7f528d0ca0657f984","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-rc.0","_nodeVersion":"8.12.0","_npmVersion":"lerna/3.13.0/node@v8.12.0+x64 (darwin)","dist":{"integrity":"sha512-MeZb1VKVaND5gn21fpp+W8QE4gvFUAeRRKW5wZqZLOHIX+4hif/ZLVZCPh0e/haeRSZ/x1M8RGVEK/6YmCU2dg==","shasum":"bb7c23f9750ac1a72c2ba5a76d9a4e503c6b3b5e","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-rc.0.tgz","fileCount":44,"unpackedSize":218637,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbvuXCRA9TVsSAnZWagAAXyMP/jTzZQKTH7fOJYSVBLXG\nkq0ti8jD/kyxzzKHoxzIT72qj9F1X+U1vipregsJCt10LmAmtP4u5W7uLhwY\navEVr75bvQrAxHYU9voWMXdXkrvYwQhtq3o9ggzBx1F1mJ7QLm2h76zurRlf\nqbPKxIbC3DI3TWhMfSsWuFQTVSuJSYKpjbWla0BhCFEIOIgp03f5Uvzfo1Da\nQR8lQD+Bk7EKI4P12QJsIv2mxft0DF72iD/Ol/cqwf2oeTLajlDGMy/KbUVc\nvZOKR1bfFog+Ntz6khn9SLHbOpxe5RKVsImxloDf9hLukWdIyeo3i+QVgokB\nYYO/tG9+BaXvVGWdT6Z4WR1pMaTufI1+73gYydl9Uvij8oWQuOeHnKDW4G0A\nww4Q2iOtXpY3u4kAl0xrCxfR+TA5kTm9PZ5IA7GgfJEdwty83CYven0AqSx4\nN0x55MFjx0F7UxsRlY2xpM263xiYUmVBv1ln+XsZv7S+Hyi8ibq/5eRGvi4a\n5HbHdKbgg9N0apYt/bBWVv/dUKIE1Mejn/qQPlLKLem1gkStrOlBQBMLm7ul\nekrZ7Hz/GJ4gBxi/x//QXA5xec3vmfuWDtkJA5JvCq2z3ApzwlQgzFlrzV0G\nAVUMIIwe1Med++M6YJW/1TtqpzGZm1NFNmR7M9hFHtAkvP4FFd3o7Q4iVYkJ\n52sD\r\n=5iif\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjo/SNjTO1GWChj5FaH0CsNCUmKGjPLKP8NPFb/wWbtQIhAKIA0ha2URg2MDX90zqUOocHjq/GhH3QuaFHiOzKWWcu"}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-rc.0_1550777238514_0.34698516258550627"},"_hasShrinkwrap":false},"4.2.0-rc.1":{"name":"graphql-anywhere","version":"4.2.0-rc.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"tsc -w","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.2.0-rc.1","tslib":"^1.9.3"},"gitHead":"559a94807cc9a2ae28ecc51ca412857b63f726b6","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-rc.1","_nodeVersion":"8.12.0","_npmVersion":"lerna/3.13.0/node@v8.12.0+x64 (darwin)","dist":{"integrity":"sha512-KGtZZJZISFrbiZd53Pj+Z17KB8eks3hZZkpN/XeFZXCen4IurCyY8OT2oC2TFs2x7EiWpq0Jyo3nEGjsDXH2UA==","shasum":"85ac07ede3698e4c3bdf4c727f5b72463a442738","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-rc.1.tgz","fileCount":44,"unpackedSize":218635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbwgMCRA9TVsSAnZWagAAbbIP/AuCehIwh3A5zCCoLxYF\nwz2frIV2pEbr6atlXK4HuxIrF6c/WIPFelfB3+9fEido4VeGJyTMwmJRK4ED\n5Fmcr6bqAOJ2ohTT+g4ejFTHF2DlEvf3NycSF94mrNDS8rrGcEMECYTFSMbt\nd6StRlW+ecWkRy2nEIW00NtXmMV05vJ0v9KkGHC6OxY6WtNogC9wSNK2kN2m\n8qTaiPE3CsgUNj2OGxrpoCKpM2SeCGDKAeCE3U1YVVFYs7CdoX7Dlp90/Rv6\nrlTInm/muRVgPKs2oJVeX7Ss32VlRcEbktTNHubkcsNe7KaTWO9qW35xzxpy\nO4SIVIkIAUnJqEOwDv199ywN97xTe6Zvu7uhY1XB0I2s6I21mZLi4TosTexe\nisbOXNxWVuO3hs0X74djoLvrIxRjVtt5fohZ9HWIZ2iO7nyHJn+dnEbFn53q\nrwrnNJzUdMEFU1VNPrm/C77cmBEgEkKqv7zuKVpyHIMWFwZ2TPsBxBsBTRXm\nO7dJXNrrO8SFeGhlxrJuA9Ijzb+v2/6US+VdFSpVitPvOsl1jC95S9U0mp7u\n4nwZhc6ScK2CyIYlm9emxgXjpJdgB0/0HAWtZqZnGdiZyGqjQ6pJ2aHgsoEp\nTZBix4jiKt31w0oSbYQMf5s58Npj6w8JIG7O+Mn8scFf9GAF9AoJYpIvc046\novT7\r\n=EOr1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9sVWswHHGc67h2f0GQoZvlFFUQyAbRs9Sp7FxdhIYQAIhALPKYUpRcJ9+dyK4TomH/CUaz3X3L6PixZ9H/CeLsNo2"}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-rc.1_1550780426204_0.7703443705672732"},"_hasShrinkwrap":false},"4.2.0-rc.2":{"name":"graphql-anywhere","version":"4.2.0-rc.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.2.0-rc.2","tslib":"^1.9.3"},"gitHead":"8f13d4ac9c50fa294e807bbd948851292da6a5b8","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0-rc.2","_nodeVersion":"8.12.0","_npmVersion":"lerna/3.13.0/node@v8.12.0+x64 (darwin)","dist":{"integrity":"sha512-5QNG6PsJ9EghGsqvsSDcmKPiCSiC5fl9g9azuNr/j9tY+VFMaSZ6kTUPH3QbFbHLkaIEgiYDOJSLNjMX2TlMNA==","shasum":"2017d3bf5709c622e9117719ac358a2c469b904b","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0-rc.2.tgz","fileCount":44,"unpackedSize":218700,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcc9/6CRA9TVsSAnZWagAA+6wP/3rkWf3CCYQcF/kfkZZ7\nD5Oq4pAcwkfVQ8fV4YZAwNEgkTsFq49uIXUgFE8UuCf/uwCyy3jLd0+oy71a\ngJ+Y4+oOvMfLVQWeh2lzgRX2LtPQ5jPOKdO6e/wOcwT5BzMf7SJgq4jr3yXW\n755mw8/6BHdMXZShiFWcdL8Uu4fpz2ALJa7W5YvMu8u0qehqJzFSGA8ZrgMl\nHMip3W7FrU2emP0MWNhjss8iUwoKUSaSAGubeceu499LdH4YRIGuvXNDV4TU\nB3rXAt7wrYAaIM4dEZKDII5dltNV8aWB4vXIhXOFTpV7FXPo9gFGWWG3RxHN\nkedPp22dWYgLdU0wKj40rB6mIJAbOWu5Bnb4/HCDu6HXtM90p7EQOJk/9g8B\nNj4j3I+hBpQxXWMXKRcfMi2n0Ds4haZaYmA7uLZdvCJQ3+AYZkCG/DtwXss6\n6VotUe1VAlophWVa8T+E4/IcuHUCn2d7PA+a8jYEOhZ0X9drQp4MTm+QXcAv\nGaqTNV+D0K6TR+bnTMSrW83wXyNT5/43BR3yCUEU3ntwye1ZFIBwQM+90ta2\n8CVj7EnL/dNJgfHeKlt7RgzE6Cs/c6JUJwHCrz2kWXP8N/foi2wC911d7/tO\nAF5mmKy9bRDMPdQA5Gqqeq9r+eB8FZ0Z6D89EmIk4SthDcyIXByxSrGpbGkh\nMSXx\r\n=0bDB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDpMleVHr24kmBmzp8kHi19JtZacDNZ7BHE+zmEv1Je5AiEA1HrlC8iTjA8EZe/X1Dbyruv4FLVFrdFiodEs5CfudjM="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0-rc.2_1551097849353_0.3253075037820934"},"_hasShrinkwrap":false},"4.2.0":{"name":"graphql-anywhere","version":"4.2.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.2.0","tslib":"^1.9.3"},"gitHead":"bc740e09d1b40d2186933e4793d8d66ae8e627ef","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.0","_nodeVersion":"8.12.0","_npmVersion":"lerna/3.13.0/node@v8.12.0+x64 (darwin)","dist":{"integrity":"sha512-s/esf/RQ8wxRIS1qSgfhgtsxhwEorhmtMnNVRfNZ/vTCVVOwnwPg48O03QTjdng+hvfUfEaXq5Re7HED18NADQ==","shasum":"0e9a98efddc648f6eb8f01829ff9810a571ac34a","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.0.tgz","fileCount":44,"unpackedSize":218690,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdZZRCRA9TVsSAnZWagAAjuEP/RV5YvLwV2cLjYDebpkQ\npxHG9qHZ6epiBqSKflFIyLThrrWkhDn3YBlNUoRQ7azKiEzSAoqgKkm5y3nE\n+3XN6vpYrR+ceXr6l96zxKDDHeBQwZAQLvKyn6qLisrgA1KKjic8rmZB5qf5\ni45c5oEuYt1znnzVdGN+c/2hDtV2yBqogVgMo8Nn8qY48J+ruA11xZypkGE5\nBxM234XtZsOvK4rV9wHRWqvW3xRSuTDf57Lizt27cFMFPKijPx3RT8AgDVq3\nBtK5Re3dSW486W8SbH279S0826EKxgoR/C+ZJV1Qxx4Cq3N8VTsd6hgkTSIT\nHimt+IuspkUH+5JVXFjLyA1jdEgltmeK/UPS/Jh3NvC1IfPu8zs1is53BRY/\nbIz+JgmCgj/X9F9XbzgqEU5gnI41iq1BdfxivE5/5sfZ9jGPXMmrYm/QTDpy\nYOzs8B60+gt24T19V5zcYA4TTIHrEbFGsMk0RIadC/jFNtVUbGjset3Yyr0O\nUSF7z4USwsJgahVbxVWZIXnG77397etrmIBOosHKzdhyz0b6LBxaZ8tO/ByX\n2xv+rKiCKRMYxG6qH6Qu9WVBVvnbBXfxlpOOmvtzHNHSjLubBePjt+ssOppz\np5634pYKrg6YVA8Mib98fAP8NulIqTWQvfBaLUGCckv5zhf/7UE2X6G3YFCO\nsDCI\r\n=lMkZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHnXnNA63CxFLzEVIven07Y78vNUnCFefsTmPCr15thOAiB7E0uiUEmhvZhDBWByAZJC8eBefuIapxzA+0iEYkJzHg=="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.0_1551210064793_0.9342030386252844"},"_hasShrinkwrap":false},"4.2.1":{"name":"graphql-anywhere","version":"4.2.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.2.1","tslib":"^1.9.3"},"gitHead":"fda77c22a43a472843954903b43bf875b2ed9d60","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.1","_nodeVersion":"8.12.0","_npmVersion":"lerna/3.13.0/node@v8.12.0+x64 (darwin)","dist":{"integrity":"sha512-4zlzTFzixGXtIYjX7BiXQOGhQ5yQVohj/EKNxUHUTAR7lHnCmrXU17gGtZ+108l9TkoHNfc33ieJ9U8trnHE1w==","shasum":"1f7c3a3d9004dbe81b1c553d7fd1ef2e16e14a85","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.1.tgz","fileCount":37,"unpackedSize":153928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdph1CRA9TVsSAnZWagAAO1AP/0AAQ2sRylFNxCFGP7S9\nqOPgP5AUgj2qzLyaH7A5LWJAd55WQoVb2sqfpgwoE0W+l+jAaw8Su1p8B9ld\nl6MnFx8ateaCoOesayN3M/Pwsn/4mpKe7qKtmKpbgMXoNVhqmB0e9cK0ZIFH\n9p70BRLnMKgrZqBg7MjihjDK5WOlQklJ1+fbhAkX3CjTZ1xKX5QrztOZRZGO\nUiv9tYmRTFlhY0Kq+GW0v+1avvGVpeGWGrECTZ/AG5jOU8ztBPQrbXfnkQqJ\nc+hDEiVMQE8ppC4nMYyEEmXLlZFa1k3+U9oImRWjpjwrHV5S8XNpnwEsqNlG\nF+E1guWlX/SDzkHcLO6UjdGUcxOoo3qDayZxqLA6fguL2Zb9M4+Em0I4Xkct\nf2iiJtwJXt/TIGhZX6fuKDd+D52h0CmjuNBDgU34BeddoBQBYnLlB3l6gp0c\nwvDHhkTX6COjpmuS31MKR/0cFcCkqZc0nHjeWNU6NPHGuhZeCm5OEj8tMPXA\n97oBnjNM2yK2gTxIEjCsZJYkV2PmXjQwVh/o4Eq7yUkeEO/qMWW8hIL9KwOQ\n+A37lTNqPrqPamXbUi7bclx9hrPAzqI/2N2uedMx2PylcXYyd9Ix/SqXZfIq\nYO28a4lGH3s6ToEY/GB0FoK4fyHZCeKnsCaj48RurS9abBX5yxMcz9Pnv0Qd\nnYDP\r\n=eBd3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGrseLzWpGWzGw9saPJ7y7RBo64AcrK5020SzCQDz9HfAiEA8V1P0oYdc8Ss9K1sNBTszzqI8a2pL/5dL0FVbsvc/Kg="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.1_1551276148546_0.011151729481088557"},"_hasShrinkwrap":false},"4.2.2-beta.0":{"name":"graphql-anywhere","version":"4.2.2-beta.0","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.3.0-beta.0","tslib":"^1.9.3"},"gitHead":"bd691bc247621084b953ad0ca36f056b4e0ce845","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.2-beta.0","_nodeVersion":"8.15.1","_npmVersion":"lerna/3.13.1/node@v8.15.1+x64 (darwin)","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-YVEvcEt5FWnZlQB2ngPwoFt7QcvdSke7AEm87sbfk4oDiMBgj7OdV/3NmjBX+Vq6xRswBCxUapvWUMFi9RWbZg==","shasum":"6acb8c6c8a06eb24d6784286b872aa0b81a48f4f","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.2-beta.0.tgz","fileCount":37,"unpackedSize":153942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJci9PRCRA9TVsSAnZWagAAHngP/RTdsB7gvh7QD0pEt6Zh\nM/MQehCiB2qyY/5lpRLuM73pA7DiDD/cJ7Cs9XQMDeF/6xdyl8NBalc6PLUp\nwWn97MjMUE/tlzyhrvujSpJd02A7hr+F1MjiK+BDvrLgaqpywsOe8BvSOasg\n5Me48jAZDi84CCWm4uIV95huIynfjt6UsJYSuZp/KrAXkkDmtlSMRY75b/gM\nRT/7FEOWtiv13unMmswwHQcTyFm/aLCVojrsVRikB/TVYblAg2LFcHFT+GsS\naCSjfA5ua6jzHRnCFBaIrfADExm9dI3MmGBgAHEfM95t/LOb+7sfN91n18zW\nla2HkE/XP4oIREUmv2sffpSLc1XK66AC3uFe2Eu7XoaB1/jEc6uu7g1Kis4p\n1VusqLL/q42nWY+EZw8XbFLhj2uN8kSIu659APDdvNQNYR2vBvrgQ0ON1e4h\npmrWS8VAF5PkzC0woc/MjTxNuNEu5Vk84KwjetX5SG71Cj2XJfAjNKh6nQe6\nOvCXudJvb8y9ptzBkbNyhMYdPe7Yol/SiVUqZwNklhofoMkX3ysjHy2i/u1O\nW3INnk85EgXTgkx9k8lkfqLllT/VD5I/mUz4oSVz1Lm44cbSnA3aoziZIwRi\nTTrcfcUgmY95M69MLFjYhwSNZg3M2ZaRXplUO6tvcVLT+tUbmLP6zzqK6gew\n66T2\r\n=Ys3H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEYg3nvdu3Pc14oFDRHRndZyfpQNZwpu5/ISNn4o/KlAIgOgSKxU7zU4nfGKqDB9J6USzTOV23qCyUFA65UCY6ZCg="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.2-beta.0_1552667601110_0.881743674564957"},"_hasShrinkwrap":false},"4.2.2-beta.1":{"name":"graphql-anywhere","version":"4.2.2-beta.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.3.0-beta.1","tslib":"^1.9.3"},"gitHead":"68169f31a4d4d41af9a90ae1fed4414255e829a3","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.2-beta.1","_nodeVersion":"8.15.1","_npmVersion":"lerna/3.13.1/node@v8.15.1+x64 (darwin)","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-z5jN4QQhCFuNqZ3ydrXZeAioGtQ+TPmLMcsNDeTZl+LTv/J8s1gmq/ALy3v9jsGYPTG4y8jDOhsK1P1WX4l+XQ==","shasum":"84e61901f4b2a2075fab6682d12dd5d434aa78c6","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.2-beta.1.tgz","fileCount":37,"unpackedSize":153942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJclSHtCRA9TVsSAnZWagAAGjUQAJK8EFb2X03vgI9pKYtP\nAxNxcD03XU0NijjxdPrHeDoBlAvN1GmUzazz9rWVymawLC/mvbmaQmO+hqHF\nkOPsydGJ4i9mhJISSkKbLazc5KCCwU8HMyOvTTHri/ju9Pb4Cd8SXeshIumJ\nvNQhRh2diluQS1mCm5P/gY+yyNHelXce8rujxeuheb1kx/vuucjvlvx5Vqxg\nxC4mgZ+cbKyYdmwPRcOYWMumd/kMd1mkENckIIwCp4yOavR50E865CM/k4TR\n05zBALaM0pZPvuxVIRScXuKYU4rgkyzDzSgUXyFcts/PRmORZ6QZFwgNvnyU\nuEkPc5UB+aqLPLUG27FdHuBcuTjT5Qhfg4pBnlmhE0Z0pRp2A1wiDf7mnDSf\nZ33pVvx9EJ3o0aQ/CBGVtfU1DmBWPh54bT5w5HC4kXIt6DaboYErEm263XO0\n0ngZsMx1cB5bnYEl854QKEeski4w3e4wmMcqrtQKNSxTaE3R/a0Uq3QZIEch\noB3/xuZSV69jcf8pxkgdbnU8GpySby/VgRrdO5eFgJcbIVunSGyUK2siLeEL\nCPHHKskezQ7+u7GWJsc10scxT31wy/bH+QkS7QP3LD+LBsoTa0GnCbGSRGSu\nI9kDV2vXHHZtFZIR1NyI9TKjRjgpeNK42enauqeV1F7zKcnsZe/+gU3CiTS0\nIIyp\r\n=0PRi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcc0FA2y+8rAnXQA9/ziJEp/bxAutv5PnAe0Rus8foHAIhAOvahJEBPk/Qdvg/lvlUPCvxA81W4X90Fn00vieOSnXP"}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.2-beta.1_1553277420743_0.24433688553999477"},"_hasShrinkwrap":false},"4.2.2-beta.5":{"name":"graphql-anywhere","version":"4.2.2-beta.5","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.3.0-beta.5","tslib":"^1.9.3"},"gitHead":"290dcc3ffd8be2dd8509d8d662287e43a791a933","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.2-beta.5","_nodeVersion":"8.15.1","_npmVersion":"lerna/3.13.2/node@v8.15.1+x64 (darwin)","_npmUser":{"name":"benjamn","email":"ben@benjamn.com"},"dist":{"integrity":"sha512-x3hvSRX0MokWkCtj9HJLI1XPmkroGx2JPbXG+VRNkoVnYpve3uDH+Vnka0bRrR+M+CY6Gqb0EBzkzDx/yySoKg==","shasum":"e62576609ed848d2430139962c36632591c802fc","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.2-beta.5.tgz","fileCount":37,"unpackedSize":153942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJctiwWCRA9TVsSAnZWagAA4F4P/A/VQVLUkwYXaQ5hOZ5E\ntZfonmV5Du2ZJrjXi6dLcd8RiC9pwvzKOMeL0PIOmiEGe37J38k+IJdKxlQK\nUUEIdushMhAgjGWvLL1AF5uKiSSbZcaqRPl/34oOaDRSb7koQWYAeR8NALw3\nxWtvA+lWUzUq3nG9NCUoX3UL+j+hX+p2IOqiROaS4ONGwgbpIts2DDpCEH6m\nPtk5yiAEJQqqDDq/LYlKnQ0QdLv/bphTiGiJJ6JSBLDvsEdu96F1Ev0l0Vp6\nFHTp1LzK6omOX3Jb9BaTI9huRElkY/Zb7btR78ZrjFJBE0Q4QRGbg99mGum9\nZGsDoDPeAaXmhgjZ+kEM/wmt9bIkgLKcwwA8Yhr69d/571nDd1wVMLQWF1T9\nEXOXxXxg0HBqHpIl3aWNKe9ydkfKQ3cbMyzFPNuOAKXsdIJmxCwEnsjxAno5\nqw+O65X0iM5PEDUoZ5IWF8Dysh0Uq/G7cKD9IhvATj698LVqyubxXe9bBbdj\n24YiaWS6yitLVE+sNm3TEgc3AxTueSaFgVmwySgYGq6pXQaQVD5FuihGHIdA\nssiZTSlBFoTm+u8RYQl8uq/LZsZ07vSGNn1dtrUQsZq5cC+P3mmoPRQEIib/\nyfEplmmeO+6wY4Tlder2gbRELP9yYRv5k3g1bUXadRnsUUwLUdQ1GV9shMfc\nUYf9\r\n=a210\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAYlM9KGZv4iZl/v8j0pyl/PfACZ0b+OueZHiV8i/vQJAiEA2zQqNSiI6h/t0BoJ55asoPojnkWmFC+VE1mrN6gZdTI="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.2-beta.5_1555442709582_0.0521045580119639"},"_hasShrinkwrap":false},"4.2.2-beta.6":{"name":"graphql-anywhere","version":"4.2.2-beta.6","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.3.0-beta.6","ts-invariant":"^0.3.2","tslib":"^1.9.3"},"gitHead":"570291b44a3af0beea25ee2773fc1eb3352bf05d","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.2-beta.6","_nodeVersion":"8.15.1","_npmVersion":"lerna/3.13.3/node@v8.15.1+x64 (darwin)","_npmUser":{"name":"benjamn","email":"ben@benjamn.com"},"dist":{"integrity":"sha512-mlgVWNI5GQv4ZtpC4ApVqA6Hb54KNzKeZHR8PR+xdcRPhk6YIr3krd5IN40eu6Mrkx0I5Hh2Smkoi1YK4gCWzw==","shasum":"0590666bcae673e0ca8d85d82f9c9c3c64e0e21c","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.2-beta.6.tgz","fileCount":38,"unpackedSize":167497,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcvzdwCRA9TVsSAnZWagAAeiUP/jrQczZblMTh8HbjMD19\n762cQKRlFyi2tRCkUFL6FlP2na3YRI4/UIfQ0Nn/kCfi+fxXwVuDFKC1SgDW\n10BJums8d2xyYfqXudwK7k8x0620uPWk+/kml9cou3QweTJuLd0ND0vr0+xX\nda8KMSfCrCI6vR0Uf5bwFiKYbu3KRdrIFbx+g69iCchcxYGeWxCnyPqSkan/\nWEDXgJZn5BwFeCxWL/P1vRgN1KspajZrpsy7zAeb0Qsy1jVicSKOmvKIlo5d\nD2VmcWcfIdzXwSnLnobFLuUlrrrOWAW6fHTwrrMLx+nXYS07BZ9JayN9jz/L\nlb+ejQAQ1kZfFvXmsITBWhDpPhQQ6X8CFNQ0zxSFKVo6k60Stvm2NA8GhuJ6\niBnWavoBBbM2q3STF7N37K+rWACeHI9mlmSwpb5GlUEVSGgYDYrSDXcs5L40\n7a/qyDgsMFenURV/0heMjaF9u55Dhf7RnGYnsDL3nNdnVXIbWa/yBR1+yUEV\nQ12cCmkQHu9DKwH87AzxJKZv1cXzrLwumyZRkLX+6RrdL3h4cPLok6QBVnaJ\ng7G4Ip+oTuI1avO4HGV9JlHL3bx/bhDGT7QQ/HMsCg33JBY54DYz0xhSf/41\no37Kj3beLK05tDtcVHUYpftpixTl6GcBx4bdVlHiAS0EnnGCMacoTSBwcuQ8\ng9Il\r\n=ESdI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCsJSZlbdU+BL+FPg6b/6YefmlNBcCCfBQD2nXAIRZlQIgMbf5wlKICCZ8Awl78XoMQyVtRqJSHoXOZSzkPHLIBL8="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.2-beta.6_1556035439828_0.3108919267730976"},"_hasShrinkwrap":false},"4.2.2-rc.1":{"name":"graphql-anywhere","version":"4.2.2-rc.1","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.3.0-rc.1","ts-invariant":"^0.3.2","tslib":"^1.9.3"},"gitHead":"d33eb3ef994d8dd0bcdd9a158de91d582d99ec2e","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.2-rc.1","_nodeVersion":"8.16.0","_npmVersion":"lerna/3.13.4/node@v8.16.0+x64 (darwin)","_npmUser":{"name":"benjamn","email":"ben@benjamn.com"},"dist":{"integrity":"sha512-6DON8kv0KewcKYrBNzAurhOg+ncygzUqJ7bZ7IujcyGnMR8dHFtN4iGhjAiwSVNYbIVvUW6yAUwh9WglXPkp0w==","shasum":"72a760beba9539da41de68e2d24ba661d21f1833","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.2-rc.1.tgz","fileCount":38,"unpackedSize":167493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc0L/DCRA9TVsSAnZWagAAFCgP/2FEoWASaIUhWms9/gYy\nrKvjW0mC4Bobhicmp8TW4A5Rd0h606j0zv96gszIye6XwBQaX9FJwDAAJBmv\nL+D6WDPzL0p91A+kiUjV+EUFpY6HkSDe3DXHZ3d4o+ONDa8gAkfEy+Z9VFyx\ncSZxYQBx9voS9VoUeyEkDF79iSHzEPcJpadJ2Xy682pZS6zN06S7BWWfbLxO\nAKkhL54qNqWcJ5JMLjxqShvE5Ivw4styBtw2njoTPCalGghAQTvCzIfWrsk7\n6uI5dRZLCg7Ynef4Y4C6V86kkf4MeRM5LDm0gZT16G/zvw6uXWjdZJoUQEHJ\nlaoBbj3rT7uUsHEzLDfpng2GlZ7cDWBnbiaIDxE1TtnL7V1/p4vxGWmD4Y04\nPMU5TSmKe2fJp4luSx0g2QblMiyeQe9Evb72uysa2qIbGYb0lRJlxgnaSsdC\no3CLDnkDJUl3p/4fT7FifsRF1zV6lZ3ESuf47iDwsk8TFGepDZ6hkBbJwkxX\nY2o9Mb0wkL9amRrP+EYpK+GhVs8Wzc4GnjQQ6qT6LtfSA4TpDEJfcUSdnAd4\ndDZe9eTngXio8+BAJLFHqlgEMM9Czse+LePdkt6f2GAdF3p2Pokf1ONxz6xM\n3axx96p0fQhY4FIFjcm73Mf7zrd2wXclfEJD/viRD3ckLUfPMH3/i69BCBuG\nunUl\r\n=k+FV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvqxLqCgJtSNAgAvFfLvkl/YNzA1gOAPUhuHF/G2G7pAIhALzXAq6Hofci/ELOOtXOnHyGj78/45o06Wqd+TpJwCm6"}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.2-rc.1_1557184450479_0.6628639135279122"},"_hasShrinkwrap":false},"4.2.2-rc.2":{"name":"graphql-anywhere","version":"4.2.2-rc.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-anywhere.git"},"keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.3.0-rc.2","ts-invariant":"^0.3.2","tslib":"^1.9.3"},"gitHead":"d5106b03c790420f73df2b95e4d7ca94092a8f18","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/apollographql/graphql-anywhere/issues"},"homepage":"https://github.com/apollographql/graphql-anywhere#readme","_id":"graphql-anywhere@4.2.2-rc.2","_nodeVersion":"8.15.1","_npmVersion":"lerna/3.13.4/node@v8.15.1+x64 (darwin)","_npmUser":{"name":"benjamn","email":"ben@benjamn.com"},"dist":{"integrity":"sha512-sN2yEXzio2BVyhCgmELMCIgSFN3SCVqpBDhgPX8d1RnYe8RDlvULCZYzOExwkBwSYqWsA/DEKWOpmUAvXn1gsg==","shasum":"92dbc6ee008276116eddb266e29f0228e77e6c58","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.2-rc.2.tgz","fileCount":38,"unpackedSize":167493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc1cG/CRA9TVsSAnZWagAAOz4P/iA8hiIYhLMUYc88zpY9\n71jFv+GTyZI6a+Eip7iCBt50Xx7wKGdabmZEnxcAeULdIt7m8kD495R99FXR\nW/nJAuG3p1xZD4HGagCMukP+oL5e9aNNhBmuhcJrPfICn/H17/mS6dRI+t7v\nDVuC/dKPTSPxGwDm5Mt8FxRh0Mgk+Pv5RjthrW61ZDQ8m9C3Q6BCGOJ/XCKI\nIAMoBQzuvcxd2GwSO6CNfnzzJT+Nqxo6ODiCPpOXq0g5noXM+tb81oKcScV0\nRE4y87K95to7PDExq9GZnaI4kwYa99zDa5TIn1uxfuOFojCFsGjmRFVcaFOS\nLKvhSOvSwohbxh4IxwnMmFE1J5+4ZBTXRTpgHU4kH8tOWWGuD/v85efUS8+M\n76+sDeGnNBJISRO4fesfBL5C9reKpcnmVb5Es9JzUX8m166NxCo2oBBLcYJo\nbGkmMpL+U9T7hJprDg/rUF3pCZnt9K89CBw0m0vLAUTmsrB+G0kKJ655SfVn\nlfXXQVoG4+baDBrlcfQof3Wis51FRLyNmsHHpTg0P4DxChcORaf0Fzlv+sFg\nPSRvC/PfpTo4WpGogmVINS7pXe8d5PZu2VmGMHoaHMPA91bFNsAc9sq7JgR4\nWrAg/Pha9lWtlGxNeqki56FvuLny2SO1TARB0WSzvK5qJYVU7CL8Th+29jpG\n2y4t\r\n=yY9o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBWlsAKGTJObs5+5765X61MC9UFpB9hLDyfriu+kHuGnAiEAodtpF693xLVqbqoAMNMIICFhIjSGjzbdowSKOYFYg4w="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.2-rc.2_1557512638007_0.5474986796748802"},"_hasShrinkwrap":false},"4.2.2-rc.3":{"name":"graphql-anywhere","version":"4.2.2-rc.3","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/apollo-client.git"},"bugs":{"url":"https://github.com/apollographql/apollo-client/issues"},"homepage":"https://github.com/apollographql/apollo-client/tree/master/packages/graphql-anywhere","keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.3.0-rc.2","ts-invariant":"^0.3.2","tslib":"^1.9.3"},"gitHead":"b64b4e9a23a8ceba6d17dbac437f25fd553f987b","readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","_id":"graphql-anywhere@4.2.2-rc.3","_nodeVersion":"8.16.0","_npmVersion":"lerna/3.14.1/node@v8.16.0+x64 (darwin)","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-sdyCIcsIFwHSi4CDODNYEYZyffpzN72JknvO6KB4fTYjf+15QwofRDmP/ck1Mv26SVIkJDiQvAxOGdkMVDKlaA==","shasum":"b61eaae1bde0a99272ec8f47d23dd14ab85672e7","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.2-rc.3.tgz","fileCount":38,"unpackedSize":167703,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5ER6CRA9TVsSAnZWagAACvMP/1b7NKJU9/jATXuq0bVm\nDloYXlUJb/TLenfLOYrgEFTZ3nF/dvzSQxU8zHqHZydJQAkGXzPtNLbA9ub+\nRvsTMRaHtdqFBGpkt3DWZE2Ex93i4ovVryqO4LOLlBSuCdsTpLk+MEgBwuY7\n5OwI0aJs/RWsBuxQ3qMPHrJy9IdJKgIDrxFIuHM0qQpQPmhKIwh2FZx0l/AE\nwQP9bXcP6FUKlw0UDCF3KJ8wldf34PB7GHAUCjRMAIotYRtJdU8a28qzImXM\nHfkYKbzFyfFFdoAdl457JKdh10CRUIxnFPooOCpTEtwCxA64buMjosNSRc/U\ng6s/bK/8GdV0Y1LarWj2ukbsfy9rlpphUmgkCRwvbbEkHnenr1tUO4aElUzI\nYrldbE8NGr/+mmgl/kbXcsPMKfIUcWflD9I1wG8d4c7hklejCj6iS4uuvnTm\nRdxGSgtb2lU8TyNq0PRfInbdYXUN/8mOUc5BoKIQFkEm0IQYdib/ZcNIEJaM\nby7IVncZe6TJAl3wtRLZAqXXtZNhrdXE2SlIwqhxjeqnw8gyH3hlAZfI9AXG\nlHpQmWs8XVMJ73LM0ceY67JoBTcR3o/mZMWm+L0LhnTVGOJi4IfMWOLfuPk4\nH5+A+Nud7XVYzj3zk4Qlt/yMy3mp3i00R00mSGHOSYyWnJeS9xSgnMvVySYT\nuIn6\r\n=8nGD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbF/FqjWOfrVv9XANAbJdqENjCQ+jLBKwfM06Gy1MIaQIgGJyAfZC+5D3FnImlgFTbK7MKMcPGAabtCwD1Ao4wGBw="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.2-rc.3_1558463609168_0.5137994085625737"},"_hasShrinkwrap":false},"4.2.2":{"name":"graphql-anywhere","version":"4.2.2","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/apollo-client.git"},"bugs":{"url":"https://github.com/apollographql/apollo-client/issues"},"homepage":"https://github.com/apollographql/apollo-client/tree/master/packages/graphql-anywhere","keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.3.0","ts-invariant":"^0.3.2","tslib":"^1.9.3"},"gitHead":"6838c5b11efb7c12abe0a37ae45061bf4f28c134","_id":"graphql-anywhere@4.2.2","_nodeVersion":"8.16.0","_npmVersion":"lerna/3.14.1/node@v8.16.0+x64 (darwin)","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-NJeqf9BjkgtRKCwvJNQT2ptTnKPIHFaQ59DxcMbw/h0EcZ9gY4h/wEAuyPozsbbq+xOSKsK0CMmQnRsgyGmdyQ==","shasum":"b68126f2f8e055f323d2376dc7be7e1810f4c894","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.2.tgz","fileCount":38,"unpackedSize":167693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5FA6CRA9TVsSAnZWagAAK6cQAI5W6RfMTvcki6U+FZ7p\n5PbQxjowy/bgF83jAwDDTlEnq1M8RYVoNMuLeqwnZLMFXXlW+hYGJ6K1VRSE\nC4xr9hyLgcQmq/+Lw0FHEOektjcVK5IkQ7q6t/iawRhfDi6jvHIBTPnvZzrY\nYUkfqtKZDGuGsmQQ8NmMOPnf/ihsLzVYi4574qRhNVUan28GBz15TZaoM4EH\nTSCWmi621ibikABytxcxyZzyLxqUm4E1JADIjJHofGsQQNAEUkIAXMtaSMKG\nhIbhYjpLCGaQHKMKPO9oR1YX9hwlmUJNaXuxSvywWptYZedUWB7jealjJIUm\n4T/ndafWRn2NE3pda8u7WxO0gwmSCX8xgfPuvontx2TD9OjbJdmt5BuTr/3s\nCuF5/f8n7SshDKOwqQmePiofeV4KhwDArNIMWExMu5L+DpeDeLBCgvsMYO95\n3eYhI+v6kUFX7qU60I+15KmstS+66ObkNbjF9BstioFfmMtju149sfB4yFJW\ngXlyGKHk6lytVTs8RVdT7tHCm179Qo/AOSOQY7nX5QZXRDsnVasVcSghQX7G\nNm2UTk0m8y+2hFwfKVwNJ9foeLUpVfiPrFVtdhiPZYQ0a83XCum71DaOuHM8\n2Co4Vo5D8KVi4t1EN4zbp6MrfEkfBpIfp64j2KXsnYbQ6i8RgbY6F8e6+iHJ\nvf9f\r\n=nndy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCy/6vtklEHi+uNaYpjHx6u86q6PVVMpvCa8uxZCyg9AIgFgxsP+qtmHonvNC559NLKOc+NLrKts+0pawh5tVuZdA="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.2_1558466617870_0.9510565375029258"},"_hasShrinkwrap":false},"4.2.3":{"name":"graphql-anywhere","version":"4.2.3","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/apollo-client.git"},"bugs":{"url":"https://github.com/apollographql/apollo-client/issues"},"homepage":"https://github.com/apollographql/apollo-client/tree/master/packages/graphql-anywhere","keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.3.1","ts-invariant":"^0.3.2","tslib":"^1.9.3"},"gitHead":"4db0a7394649d8b21eaa8d5ba06dc2c3b9ee2b3a","_id":"graphql-anywhere@4.2.3","_nodeVersion":"8.16.0","_npmVersion":"lerna/3.14.1/node@v8.16.0+x64 (darwin)","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-kJiwe/I8rm+GivwwMmlVCLS3cneNXwqEyUIdo9npjEI0NtGBSNJnt8KNww7A450JvO/v+ubM5zQMh1e9LjTnBg==","shasum":"9302f7054f86cdddfbe12129a0167812a2cc4aa6","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.3.tgz","fileCount":38,"unpackedSize":166875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9pIJCRA9TVsSAnZWagAAfHoQAIQjRHJGm+dE35Qy4uir\nrXzYItYJp24h8iWLNmSYiyfsL9Zhp9szD8RMyyH22fvZIuYSGnBMzRBMgZzh\nCJT/iKDCI1RkrBjYg0OW1TePeUxxo5RS331IAQkFMbAbrejXgjbnKCJv+AJW\n0oLt+iFXKExfmMWE9FIwoHBpFvlFP6USSFIdvt/hA0H4W7H7eR321UgnPm+9\naG0X9F/70ro3G9QDQxSBLeHcXP3voH0Mmi8fNG1QgkUcFRr2DfMvii1q8CmS\nebQAL+6Qqm2Pong0WBoXcYkcBBmGEj2ADpCsvlqtFSob7Gjd+A2QfEaVJolE\nwgqvnnljxGdO0rGNYxS6RNheL8oByMgglGBlbSBzSRS6rfnbj6E4H1ZP26wh\n/Ck63OyOmvSi/JkU56dwCEYwNxizhr0meTkVI+erHZAWI3hXuYnSnpvlVca6\nzSGOZzCnr7+HpSGZHqopG/MSajTAzoUehbrGIqQNYsRm5a8YimuZvQzG02WE\ngUgc3lQMtsaNGMs559QQC5Oj3A6p3i6e42iE0dbg8tWBBbfQjvxXN8JyIujC\n/KsEgX7msAwJ/09y/t9zs0jbMDagEpaayfUsbjTo6G2Zno1ZBIiQIwWkoSzV\niYiZwBatSnJO/KEhY5qPZXv7G1hRcbjaBSQ9zoTzIlbt8PwfEfZhSY7g6V7p\n9sSq\r\n=Qaxi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxslC5ysP3dSCsY3EIpeVeV22Nur/bqpYL32kLTpvA5gIhAIK/Qju4f+3sL4yAYvLdfdLIAnRyFdUx6HDnDb8kRxUm"}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.3_1559663113329_0.723086323473608"},"_hasShrinkwrap":false},"4.2.4":{"name":"graphql-anywhere","version":"4.2.4","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/apollo-client.git"},"bugs":{"url":"https://github.com/apollographql/apollo-client/issues"},"homepage":"https://github.com/apollographql/apollo-client/tree/master/packages/graphql-anywhere","keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.3.2","ts-invariant":"^0.3.2","tslib":"^1.9.3"},"gitHead":"656fd9fbcf82df5cd6b9512e4c9b90b808e300ad","_id":"graphql-anywhere@4.2.4","_nodeVersion":"8.16.0","_npmVersion":"lerna/3.14.1/node@v8.16.0+x64 (darwin)","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"dist":{"integrity":"sha512-rN6Op5vle0Ucqo8uOVPuFzRz1L/MB+ZVa+XezhFcQ6iP13vy95HOXRysrRtWcu2kQQTLyukSGmfU08D8LXWSIw==","shasum":"7f1c08c9348c730c6bb5e818c81f0b72c13696a8","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.4.tgz","fileCount":38,"unpackedSize":166875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc+SbzCRA9TVsSAnZWagAAl0UP/0j332E8G33MvA0ravtu\ncmcDckAFl/2aCdhSf2oV8C1xu41nrN6oMTpMePe/1sGHLiW+a2ru6uPIIfTy\nkw+6lefOyR1DeO7yBiWgBVaVpXK64dr/3PL2pqoadNAQEFPQ8o6dp3l+TSMK\n1vqoqpdok8Yd64AVPjAx6f+Sa+Pe7gALhecKoanKPS6sxNk5RhJiEW5awvkr\n87xrualw/NYM7RyXxNVxc4f+oehMTLPknmeGEKrwD7Out3qWTQm6a5KwfMGK\nYuLq4eSPUCBuwrQPf5Ro2RPhpQH92xZiz/1AcmeZB1POJrW7AQuuq+PZgcEo\n3wTzTeDI00KwbFGeO+Pakn6GmqG4lAvufibn5saSk8jo7BMn2aGLJ/BgQp3L\nWkuRKrBNItlp1OD13k45Q1IrpIDnBQYgZMf8NHk7zwrDIrNDn2mUkq8H4AlB\n0/tnt8YkGTyVUFN/ORwAn5121J4GGp4NcLjYgaDPhJDwpodhPl1IbMOabFtn\nkP5Q5zA6Wfix56fkN5sIt3z7Nv5mdo6xIfUWe+yxJK2fuxHt/c5tllGVvoY0\njGvZ69uC5s3rMl+7bKXlJvPkVYu3DeBt/u+GKpRuKw7gZkyUCWM4uWs60LkG\nw6wI+veHDsGcEobpeZG0f8rczS2rCKcgMk3sK4/8LjQlv+9L7xsAnrj/A0sp\n5t1v\r\n=Y1DJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDX2Ctgu8AXiIGuZMtfEl9ah7q+Tq0a7m62xe/LKlMt8wIhAL8j6bXey3EQZEwAx/wkXCNOdfZvhptSWWc4TYv2naN/"}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.4_1559832306913_0.9022305362189682"},"_hasShrinkwrap":false},"4.2.6":{"name":"graphql-anywhere","version":"4.2.6","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"../../node_modules/rollup/bin/rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/apollo-client.git"},"bugs":{"url":"https://github.com/apollographql/apollo-client/issues"},"homepage":"https://github.com/apollographql/apollo-client/tree/master/packages/graphql-anywhere","keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.3.3","ts-invariant":"^0.3.2","tslib":"^1.10.0"},"peerDependencies":{"graphql":"^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0"},"gitHead":"68fa57751ce201ba6b72efdbf8fdda1729c991cc","_id":"graphql-anywhere@4.2.6","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.19.0/node@v10.15.3+x64 (darwin)","dist":{"integrity":"sha512-re4fqaii3l0fCsC3qFKQrmwffephI9rinrwXAy+4EnWip2YkGlV8wC4en42eW8KI2nlWBh9lkJPfR/5TZf/l1w==","shasum":"2169699d77b41b9065af7124778d432d09a63ef8","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.6.tgz","fileCount":38,"unpackedSize":167692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd9MsYCRA9TVsSAnZWagAAKXIP/RYmLogjP/tU8qhMJg4j\nA51lQoh8uXN5Qp9dTjWxLImHUOa2hRc+j5/5neCrRZoUL6cPbqE7cIQpr2tJ\nAT+uqnCD177Z7eNU7XqYAuPDIposTBcY8e+lOyBF9dtx074YIdixUncr0Ot9\nha9XeWjZ5zIov8TtYOUZLQ08E6Kbt8LduwIh5TT40KNCDMcHUiVGo1hDtOnX\nTy+Zy8sukNdGtQE73vX+HLVEqKcKD4WYJheXOOTkDDj+n5IHKVGgFuYa1oBP\nt4dCsJGND8ldeMy9W1JZ1kzyhBFq5V3JFnejruFXvcQ5VqzyvQ8uh6nJdmKx\nU6zbLI7aSqEY6EBOaEuWftuoN2kxzFGdSEJNxFZcJEaaxvm8MXsJPdYwdGDI\nU6StiLy6aWguIC/sc0Oe1Du8w1UKAI+E/PAsUmuPU6fGAVGnxiIbPEBpoG+K\nhFM1J27AIhzl3Q4iN5oFxVxdAoyuKf1Y+mynr5OBR/VtgLOmdjGpLzv7uRDE\n5QYSXZczRLAh20CKhsdVJJP2FYLgQ+HAP6p4SIVGS2NTKZK/651i0Vw0Vj1A\ngfHys1cH0ONcvFuu7UMwl0TJ7azJOqMy5wbidqfBpRWmnCLSDRldNkFCJtgt\nriByhT9fjPMKswY70rkfF+1j8qDuyZ17CoeU5uBlGphVljba1LByW6xu8j5V\nVHgw\r\n=t1jn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHdiiV7QE2lbUut42jvg922iMZf2Z3j5ZdbHySVZUo/uAiEA9wXGUNDWmLih5ONT3AOdJ8eI2r4t+1yZb1DNbfo0h9M="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.6_1576323863956_0.29895451356370084"},"_hasShrinkwrap":false},"4.2.7":{"name":"graphql-anywhere","version":"4.2.7","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"npx rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/apollo-client.git"},"bugs":{"url":"https://github.com/apollographql/apollo-client/issues"},"homepage":"https://github.com/apollographql/apollo-client/tree/master/packages/graphql-anywhere","keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.3.4","ts-invariant":"^0.3.2","tslib":"^1.10.0"},"peerDependencies":{"graphql":"^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"},"gitHead":"d22394c419ff7d678afb5e7d4cd1df16ed803ead","_id":"graphql-anywhere@4.2.7","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.20.2/node@v10.15.3+x64 (darwin)","dist":{"integrity":"sha512-fJHvVywWVWjiHuPIMs16Nfjf4zdQUwSO1LKycwBJCWIPeoeQ8LqXK2BgYoZAHkhKEFktZZeYyzS4o/uIUG0z5A==","shasum":"c06fb40b1d62b39470c80e3731478dbbef060067","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.7.tgz","fileCount":38,"unpackedSize":167677,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetowICRA9TVsSAnZWagAATBgP/i0lmYFoRPMRpl7Zo/ou\nfB8aclRFGBA/2H3M0R/L3V78KHXUXvIIYsEjap5j2oWdvvC1Ybje+cKkQQlv\nxZuCbENyWsgiV0STCUAqx6SHwsq8s16xtCWEEgagy17O9t267c2wf52JVLgK\ne7l70vCA6xCYCkvIY7IXlr7O9DmeZ9T5x/BJp+F6oLvf6JB21sSHH8fyCzlR\npBa7W+rp6norvx5+lU2fl3PDrqATR5C2YY1lq23xoDHk5CroycrjFpN2tIol\nzLTiWWNC/qSJC5OF6X3qrR6c/d13xtNJ8RY8hEWXHxtZlCCoym1GxD50NDGY\nKyqF1GO5c+CT/9Gi9zJqNWmUtmRbHQH0YgmkqScodTis4ZnOyPGmpkDrgJjc\n8MczrKB7BOSXTuhLe+jL03KQW4+bm2peSwYIpiKnV7DdjVVImscfPtYKkOy1\nf++AFGL5PbC4KCjuWQLhD8qWgLLe+Ol+XypYYt5Ktm0+rzrNPXGMKJ35NpwI\nVOS/NaTBeIKy/H5/wbXzg03zaRMZOZO3h3nuB7fYvfgjgZA4rWYh07yC+tjt\n6z0Zo3JLgWQV2sn7PtJ00TFpg3XhR4936rRX6tyLrmonS3Kn9wGzviJP/0wl\n3M31sZlGsSaJiyoxK/t7Yux8nrwQLQnxGwSZtl0DezRpSYPwhW0O41+TrZIA\nqvUL\r\n=1hqW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEMGITOnevLxtq7ib0N13ChobtUlZGrY99rApTgU9RppAiApPQYOFQurdkgfqlfdx09IKfgjPKs4dJ8Hh82xYV9hPQ=="}]},"maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"ben@benjamn.com","name":"benjamn"},{"email":"jonas@helfer.email","name":"helfer"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"peggyrayzis@gmail.com","name":"peggyrayzis"},{"email":"s.stubailo@gmail.com","name":"sashko"},{"email":"tom@thesnail.org","name":"tmeasday"}],"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.7_1589021704100_0.14663057806502455"},"_hasShrinkwrap":false},"4.2.8":{"name":"graphql-anywhere","version":"4.2.8","description":"Run GraphQL queries with no schema and just one resolver","main":"./lib/bundle.cjs.js","module":"./lib/bundle.esm.js","typings":"./lib/index.d.ts","sideEffects":false,"scripts":{"prepare":"npm run lint && npm run build","coverage":"jest --coverage","test":"tsc -p tsconfig.json --noEmit && jest","build":"tsc -b .","postbuild":"npm run bundle","bundle":"npx rollup -c rollup.config.js","watch":"../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"","prepublishOnly":"npm run build","lint":"tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts","clean":"rm -rf coverage/* lib/*"},"repository":{"type":"git","url":"git+https://github.com/apollographql/apollo-client.git"},"bugs":{"url":"https://github.com/apollographql/apollo-client/issues"},"homepage":"https://github.com/apollographql/apollo-client/tree/master/packages/graphql-anywhere","keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}],"license":"MIT","dependencies":{"apollo-utilities":"^1.3.4","ts-invariant":"^0.3.2","tslib":"^2.4.0"},"peerDependencies":{"graphql":">= 0.11.0"},"readme":"# graphql-anywhere\n\n[![npm version](https://badge.fury.io/js/graphql-anywhere.svg)](https://badge.fury.io/js/graphql-anywhere)\n[![Build Status](https://travis-ci.org/apollographql/graphql-anywhere.svg?branch=master)](https://travis-ci.org/apollostack/graphql-anywhere)\n\n> ⚠️ This package is no longer used by Apollo Client as of version 3.0, has been deprecated, and will no longer be maintained. ⚠️\n\nRun a GraphQL query anywhere, without a GraphQL server or a schema. Just pass in one resolver. Use it together with [graphql-tag](https://github.com/apollographql/graphql-tag).\n\n```\nnpm install graphql-anywhere graphql-tag\n```\n\nI think there are a lot of potentially exciting use cases for a completely standalone and schema-less GraphQL execution engine. We use it in [Apollo Client](https://github.com/apollostack/apollo-client) to read data from a Redux store with GraphQL.\n\nLet's come up with some more ideas - below are some use cases to get you started!\n\n## API\n\n```js\nimport graphql from 'graphql-anywhere'\n\ngraphql(resolver, document, rootValue?, context?, variables?, options?)\n```\n\n- `resolver`: A single resolver, called for every field on the query.\n    - Signature is: `(fieldName, rootValue, args, context, info) => any`\n- `document`: A GraphQL document, as generated by the template literal from `graphql-tag`\n- `rootValue`: The root value passed to the resolver when executing the root fields\n- `context`: A context object passed to the resolver for every field\n- `variables`: A dictionary of variables for the query\n- `options`: Options for execution\n\n#### Options\n\nThe last argument to the `graphql` function is a set of `graphql-anywhere`-specific options.\n\n- `resultMapper`: Transform field results after execution.\n    - Signature is: `(resultFields, resultRoot) => any`\n- `fragmentMatcher`: Decide whether to execute a fragment. Default is to always execute all fragments.\n    - Signature is: `(rootValue, typeCondition, context) => boolean`\n\n#### Resolver info\n\n`info`, the 5th argument to the resolver, is an object with supplementary information about execution. Send a PR or open an issue if you need additional information here.\n\n- `isLeaf`: A boolean that is `true` if this resolver is for a leaf field of the query, i.e. one that doesn't have a sub-selection.\n- `resultKey`: The key the result of this field will be put under. It's either the field name from the query, or the field alias.\n- `directives`: An object with information about all directives on this field. It's an object of the format `{ [directiveName]: { [argumentName]: value }}`. So for example a field with `@myDirective(hello: \"world\")` will be passed as `{ myDirective: { hello: 'world' }}`. Note that fields can't have multiple directives with the same name, as written in the GraphQL spec.\n\n\n## Utilities\n\nSee https://www.apollographql.com/docs/react/advanced/fragments.html for examples of how you might use these.\n\n```js\nimport { filter } from 'graphql-anywhere'\n\nfilter(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data to be filtered by the `doc`\n\nFilter `data` according to `doc`.\n\n\n```js\nimport { check } from 'graphql-anywhere'\n\ncheck(doc, data);\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n- `data`: an object of data, as may have been filtered by `doc`.\n\nCheck that `data` is of the form defined by the query or fragment. Throw an exception if not.\n\n```js\nimport { propType } from 'graphql-anywhere'\n\nX.propTypes = {\n  foo: propType(doc),\n  bar: propType(doc).isRequired,\n}\n\n```\n\n- `doc`: a GraphQL document, as generated by the template literal from `graphql-tag`, typically either a query or a fragment.\n\nGenerate a React `propType` checking function to ensure that the passed prop is in the right form.\n\n### Supported GraphQL features\n\nWhy do you even need a library for this? Well, running a GraphQL query isn't as simple as just traversing the AST, since there are some pretty neat features that make the language a bit more complex to execute.\n\n- [x] Arguments\n- [x] Variables\n- [x] Aliases\n- [x] Fragments, both named and inline\n- [x] `@skip` and `@include` directives\n\nIf you come across a GraphQL feature not supported here, please file an issue.\n\n<a id=\"filter\"></a>\n## Example: Filter a nested object\n\n```js\nimport gql from 'graphql-tag';\nimport graphql from 'graphql-anywhere';\n\n// I don't need all this stuff!\nconst gitHubAPIResponse = {\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": {\n    \"login\": \"octocat\",\n    \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n    \"url\": \"https://api.github.com/users/octocat\",\n  },\n  \"labels\": [\n    {\n      \"url\": \"https://api.github.com/repos/octocat/Hello-World/labels/bug\",\n      \"name\": \"bug\",\n      \"color\": \"f29513\"\n    }\n  ],\n};\n\n// Write a query that gets just the fields we want\nconst query = gql`\n  {\n    title\n    user {\n      login\n    }\n    labels {\n      name\n    }\n  }\n`;\n\n// Define a resolver that just returns a property\nconst resolver = (fieldName, root) => root[fieldName];\n\n// Filter the data!\nconst result = graphql(\n  resolver,\n  query,\n  gitHubAPIResponse\n);\n\nassert.deepEqual(result, {\n  \"title\": \"Found a bug\",\n  \"user\": {\n    \"login\": \"octocat\",\n  },\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n    }\n  ],\n});\n```\n\n<a id=\"mock\"></a>\n## Example: Generate mock data\n\n```js\n// Write a query where the fields are types, but we alias them\nconst query = gql`\n  {\n    author {\n      name: string\n      age: int\n      address {\n        state: string\n      }\n    }\n  }\n`;\n\n// Define a resolver that uses the field name to determine the type\n// Note that we get the actual name, not the alias, but the alias\n// is used to determine the location in the response\nconst resolver = (fieldName) => ({\n  string: 'This is a string',\n  int: 5,\n}[fieldName] || 'continue');\n\n// Generate the object!\nconst result = graphql(\n  resolver,\n  query\n);\n\nassert.deepEqual(result, {\n  author: {\n    name: 'This is a string',\n    age: 5,\n    address: {\n      state: 'This is a string',\n    },\n  },\n});\n```\n<a id=\"normalizr\"></a>\n## Example: Read from a Redux store generated with Normalizr\n\n```js\nconst data = {\n  result: [1, 2],\n  entities: {\n    articles: {\n      1: { id: 1, title: 'Some Article', author: 1 },\n      2: { id: 2, title: 'Other Article', author: 1 },\n    },\n    users: {\n      1: { id: 1, name: 'Dan' },\n    },\n  },\n};\n\nconst query = gql`\n  {\n    result {\n      title\n      author {\n        name\n      }\n    }\n  }\n`;\n\nconst schema = {\n  articles: {\n    author: 'users',\n  },\n};\n\n// This resolver is a bit more complex than others, since it has to\n// correctly handle the root object, values by ID, and scalar leafs.\nconst resolver = (fieldName, rootValue, args, context): any => {\n  if (!rootValue) {\n    return context.result.map((id) => assign({}, context.entities.articles[id], {\n      __typename: 'articles',\n    }));\n  }\n\n  const typename = rootValue.__typename;\n  // If this field is a reference according to the schema\n  if (typename && schema[typename] && schema[typename][fieldName]) {\n    // Get the target type, and get it from entities by ID\n    const targetType: string = schema[typename][fieldName];\n    return assign({}, context.entities[targetType][rootValue[fieldName]], {\n      __typename: targetType,\n    });\n  }\n\n  // This field is just a scalar\n  return rootValue[fieldName];\n};\n\nconst result = graphql(\n  resolver,\n  query,\n  null,\n  data // pass data as context since we have to access it all the time\n);\n\n// This is the non-normalized data, with only the fields we asked for in our query!\nassert.deepEqual(result, {\n  result: [\n    {\n      title: 'Some Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n    {\n      title: 'Other Article',\n      author: {\n        name: 'Dan',\n      },\n    },\n  ],\n});\n```\n\n## Example: Generate React components\n\nYou can use the `resultMapper` option to convert your results into anything you like. In this case, we convert the result fields into children for a React component:\n\n```js\nconst resolver = (fieldName, root, args) => {\n  if (fieldName === 'text') {\n    return args.value;\n  }\n\n  return createElement(fieldName, args);\n};\n\nconst reactMapper = (childObj, root) => {\n  const reactChildren = Object.keys(childObj).map(key => childObj[key]);\n\n  if (root) {\n    return cloneElement(root, root.props, ...reactChildren);\n  }\n\n  return reactChildren[0];\n};\n\nfunction gqlToReact(query): any {\n  return graphql(\n    resolver,\n    query,\n    '',\n    null,\n    null,\n    { resultMapper: reactMapper },\n  );\n}\n\nconst query = gql`\n  {\n    div {\n      s1: span(id: \"my-id\") {\n        text(value: \"This is text\")\n      }\n      s2: span\n    }\n  }\n`;\n\nassert.equal(\n  renderToStaticMarkup(gqlToReact(query)),\n  '<div><span id=\"my-id\">This is text</span><span></span></div>'\n);\n```\n","readmeFilename":"README.md","gitHead":"d7edf00c4917cd4acccb92e2baf43c71a2a01e97","_id":"graphql-anywhere@4.2.8","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-bKeJJoY9JyWMAiz5isKrtYUdIUBOBiXUOrA9CQgs9Drh9itFtxhWndQH4UBuYfrMticum6Oj1uQ6iSvZk94cMQ==","shasum":"136ede3142268f96f67c9a7d13ba37bff640aeb7","tarball":"https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.2.8.tgz","fileCount":37,"unpackedSize":165654,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBdw7/aa3zS5FIkEjepmxGigwEhkZK7Im+JGrApNSSWAIgFWvAGbrHOpb4JOFJrV+3/wfhnNpySuyMEgXqbLwZns8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUaoEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoO8g//V/CrppqOrY+G9aox0m6tDCs9qonoIVtys/lkwuLjuj+7LSUh\r\nQSqBSFoVplqLynHF9QJrFgowy1t+aeGxtZz+x6cWWUU8TlCiiVm57KX6tkD0\r\nzjps2PLfhcMfCrKN6T19bADOgMvGXIfVRlSP9nOtG51tzaM72Cb3BaQxOD/J\r\nFVxMj47NzuPm6nHOWOVJMKDvVFbR+SqU/ANp8U4tbNvNF4jmexXVEBX57GDA\r\n80BlnrnB3MnrD6sN1NTcBXtqUJTQuO91pfxvGej7JhOZFIvX5Z/tlWpmHPWO\r\n2QvZ62ji5x41Fg9iuctSVQ+/mAbCaJiOc+wQfYH6SQMJCAwteVPs8MaGml4E\r\nMGSst8WtQobSDzgPJrW+5DXlFV2b4CC+furXN7CnSf8XcYSF8/yTu85ngY2l\r\nSLJSb4p2xJbg2oTbkEn0D4WZb+Ngj9WayyAYGbUJCaYA6mnyJ36hPCcdFrKc\r\nxCFEAKMEQl9isQX/OWbXAj61KWjoIcvC0oUWKrO5kYwNGDWSiCUUQIBv6/gi\r\nGI6Vqiix3+MfCFUqUyM6rTI9+zyv0LcHy/PFOroBWW2EED/5qaHx0MJu9Fhn\r\nnqAGbUmqKqTfVSih09e4Sq5vdJRzfvlQTR8qpXhZPZVGru0jKntQN1LNvJRg\r\njAIya17yPF9XUrA6jsw6xn5ra5tcmCJHaIk=\r\n=SQT6\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"benjamn","email":"ben@benjamn.com"},"directories":{},"maintainers":[{"name":"benjamn","email":"ben@benjamn.com"},{"name":"tmeasday","email":"tom@thesnail.org"},{"name":"jbaxleyiii","email":"james@apollographql.com"},{"name":"sashko","email":"s.stubailo@gmail.com"},{"name":"helfer","email":"helfer@protonmail.com"},{"name":"peggyrayzis","email":"peggyrayzis@gmail.com"},{"name":"apollo-bot","email":"npm@apollographql.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-anywhere_4.2.8_1666296323897_0.2575271689197205"},"_hasShrinkwrap":false}},"readme":"","maintainers":[{"name":"benjamn","email":"ben@benjamn.com"},{"name":"tmeasday","email":"tom@thesnail.org"},{"name":"jbaxleyiii","email":"james@apollographql.com"},{"name":"sashko","email":"s.stubailo@gmail.com"},{"name":"helfer","email":"helfer@protonmail.com"},{"name":"peggyrayzis","email":"peggyrayzis@gmail.com"},{"name":"apollo-bot","email":"npm@apollographql.com"}],"time":{"modified":"2022-10-20T20:07:57.160Z","created":"2016-08-25T07:43:50.715Z","0.1.0":"2016-08-25T07:43:50.715Z","0.1.1":"2016-08-25T08:03:30.086Z","0.1.2":"2016-08-25T08:06:31.731Z","0.1.3":"2016-08-25T08:16:49.730Z","0.1.4":"2016-08-26T23:55:36.988Z","0.1.5":"2016-09-02T04:34:55.249Z","0.1.6":"2016-09-03T05:34:11.527Z","0.1.7":"2016-09-13T17:51:26.168Z","0.1.8":"2016-10-05T04:13:52.790Z","0.1.9":"2016-10-05T04:38:49.188Z","0.1.10":"2016-10-05T04:45:16.458Z","0.1.11":"2016-10-05T05:23:33.522Z","0.1.12":"2016-10-08T18:24:43.683Z","0.1.13":"2016-10-09T17:16:40.577Z","0.1.14":"2016-10-09T17:18:56.784Z","0.2.0":"2016-10-13T16:05:16.649Z","0.2.1":"2016-10-13T16:11:02.082Z","0.2.2":"2016-10-15T23:38:50.429Z","0.2.3":"2016-10-15T23:40:58.459Z","0.2.4":"2016-10-19T07:48:24.159Z","0.3.0":"2016-11-17T05:46:50.537Z","1.0.0":"2016-11-23T02:28:45.979Z","1.1.0":"2016-12-14T09:21:10.384Z","1.1.1":"2016-12-14T09:53:48.448Z","1.1.2":"2016-12-14T10:04:14.714Z","2.0.0":"2017-01-05T01:38:39.547Z","2.1.0":"2017-01-25T22:46:23.136Z","2.2.0":"2017-02-06T23:09:29.180Z","3.0.0":"2017-03-16T01:35:46.258Z","3.0.1":"2017-03-16T04:24:42.021Z","3.1.0":"2017-06-05T05:46:45.130Z","4.0.0-0":"2017-08-11T19:38:12.758Z","4.0.0-alpha.2":"2017-09-04T03:42:54.202Z","4.0.0-alpha.3":"2017-09-05T15:39:35.824Z","4.0.0-alpha.4":"2017-09-07T03:44:09.175Z","4.0.0-alpha.5":"2017-09-08T04:24:44.075Z","4.0.0-alpha.6":"2017-09-08T17:33:23.581Z","4.0.0-beta.0":"2017-09-13T15:09:39.606Z","4.0.0-beta.1":"2017-09-21T12:42:05.605Z","4.0.0-beta.2":"2017-09-26T14:10:31.910Z","4.0.0-beta.3":"2017-10-03T18:43:17.398Z","4.0.0-beta.4":"2017-10-11T02:10:32.644Z","4.0.0-beta.5":"2017-10-11T08:01:12.086Z","4.0.0-rc.0":"2017-10-11T08:09:59.636Z","4.0.0-rc.1":"2017-10-20T00:05:09.798Z","4.0.0-rc.2":"2017-10-20T14:26:23.621Z","4.0.0-rc.3":"2017-10-24T05:27:27.740Z","4.0.0":"2017-10-24T18:52:17.602Z","4.0.1":"2017-11-16T02:57:27.049Z","4.0.2":"2017-11-30T19:03:19.400Z","4.1.0-alpha.0":"2017-12-05T13:13:18.978Z","4.1.0":"2017-12-08T15:29:14.433Z","4.1.1":"2018-01-05T20:35:10.492Z","4.1.2":"2018-01-29T17:30:49.782Z","4.1.3":"2018-02-02T16:00:16.869Z","4.1.4":"2018-02-14T20:16:23.524Z","4.1.5":"2018-02-14T23:56:13.821Z","4.1.6":"2018-03-06T17:02:09.771Z","4.1.7":"2018-03-13T17:27:16.614Z","4.1.8":"2018-03-26T13:35:54.080Z","4.1.9":"2018-05-02T18:27:05.069Z","4.1.10":"2018-05-04T21:54:50.828Z","4.1.11":"2018-05-30T02:05:23.137Z","4.1.12":"2018-06-13T10:36:21.228Z","4.1.13":"2018-06-14T02:08:06.993Z","4.1.14":"2018-06-20T01:26:54.964Z","4.1.15-alpha.1":"2018-07-19T17:29:37.265Z","4.1.15-alpha.2":"2018-07-23T13:56:49.810Z","4.1.15":"2018-07-24T19:39:29.565Z","4.1.15-alpha.3":"2018-07-24T21:27:59.044Z","4.1.15-alpha.4":"2018-07-25T00:44:15.726Z","4.1.15-alpha.5":"2018-07-25T04:40:06.256Z","4.1.15-alpha.6":"2018-07-25T05:21:54.251Z","4.1.15-alpha.7":"2018-07-25T05:26:54.658Z","4.1.15-alpha.8":"2018-07-25T18:16:44.208Z","4.1.15-alpha.9":"2018-07-25T18:50:08.171Z","4.1.15-alpha.10":"2018-07-25T19:07:59.427Z","4.1.15-alpha.12":"2018-07-27T01:23:33.166Z","4.1.15-alpha.13":"2018-07-31T08:05:48.010Z","4.1.15-alpha.14":"2018-08-08T02:18:48.509Z","4.1.16":"2018-08-09T12:10:22.088Z","4.1.17":"2018-08-17T14:00:45.954Z","4.2.0-verify.1":"2018-08-17T16:42:32.841Z","4.2.0-verify.2":"2018-08-17T17:09:42.897Z","4.2.0-verify.3":"2018-08-17T18:11:17.844Z","4.2.0-verify.4":"2018-08-17T18:43:35.759Z","4.1.18":"2018-08-26T16:30:38.771Z","4.1.19":"2018-09-12T09:38:10.960Z","4.1.20-local-state-alpha.0":"2018-10-04T17:24:27.040Z","4.1.20-local-state-alpha.1":"2018-10-04T17:39:52.877Z","4.1.20-local-state-alpha.2":"2018-10-05T02:47:56.235Z","4.1.20-local-state-alpha.3":"2018-10-05T13:39:50.887Z","4.1.20-local-state-alpha.4":"2018-10-05T13:52:32.384Z","4.1.20-local-state-alpha.5":"2018-10-05T19:29:24.163Z","4.1.20-local-state-alpha.6":"2018-10-07T15:44:45.468Z","4.1.20-local-state-alpha.7":"2018-10-09T18:53:18.250Z","4.1.20-local-state-alpha.8":"2018-10-09T20:33:15.960Z","4.1.20-local-state-alpha.9":"2018-10-19T18:57:08.371Z","4.1.20":"2018-10-22T22:54:38.555Z","4.1.20-local-state-alpha.10":"2018-10-23T15:26:24.756Z","4.1.20-local-state-alpha.11":"2018-10-25T18:31:01.259Z","4.1.20-local-state-alpha.12":"2018-10-26T13:07:19.962Z","4.1.21":"2018-10-26T17:39:30.229Z","4.1.22":"2018-10-30T15:24:32.012Z","4.1.20-local-state-alpha.13":"2018-11-06T00:24:07.463Z","4.1.20-local-state-alpha.14":"2018-11-06T18:50:59.288Z","4.2.0-alpha.1":"2018-11-06T23:38:35.905Z","4.1.23":"2018-11-21T18:14:01.484Z","4.2.0-alpha.2":"2018-12-11T01:29:31.855Z","4.1.24":"2018-12-19T19:38:09.869Z","4.2.0-alpha.3":"2019-01-14T01:19:51.894Z","4.2.0-alpha.5":"2019-01-14T01:44:18.520Z","4.2.0-alpha.7":"2019-01-14T01:55:53.628Z","4.2.0-alpha.8":"2019-01-14T14:44:00.543Z","4.2.0-alpha.9":"2019-01-14T17:26:13.353Z","4.1.25":"2019-01-17T20:18:21.158Z","4.1.26":"2019-01-18T17:25:41.437Z","4.1.27":"2019-01-18T22:17:39.176Z","4.2.0-beta.0":"2019-02-01T17:22:26.649Z","4.2.0-beta.1":"2019-02-07T19:23:39.578Z","4.1.28":"2019-02-13T18:07:51.985Z","4.2.0-rc.0":"2019-02-21T19:27:18.706Z","4.2.0-rc.1":"2019-02-21T20:20:26.402Z","4.2.0-rc.2":"2019-02-25T12:30:49.593Z","4.2.0":"2019-02-26T19:41:04.936Z","4.2.1":"2019-02-27T14:02:28.767Z","4.2.2-beta.0":"2019-03-15T16:33:21.314Z","4.2.2-beta.1":"2019-03-22T17:57:00.863Z","4.2.2-beta.5":"2019-04-16T19:25:09.749Z","4.2.2-beta.6":"2019-04-23T16:03:59.936Z","4.2.2-rc.1":"2019-05-06T23:14:10.630Z","4.2.2-rc.2":"2019-05-10T18:23:58.259Z","4.2.2-rc.3":"2019-05-21T18:33:29.287Z","4.2.2":"2019-05-21T19:23:37.999Z","4.2.3":"2019-06-04T15:45:13.434Z","4.2.4":"2019-06-06T14:45:07.127Z","4.2.6":"2019-12-14T11:44:24.076Z","4.2.7":"2020-05-09T10:55:04.371Z","4.2.8":"2022-10-20T20:05:24.164Z"},"homepage":"https://github.com/apollographql/apollo-client/tree/master/packages/graphql-anywhere","keywords":["ecmascript","es2015","jsnext","javascript","relay","npm","react"],"repository":{"type":"git","url":"git+https://github.com/apollographql/apollo-client.git"},"author":{"name":"Sashko Stubailo","email":"sashko@stubailo.com"},"bugs":{"url":"https://github.com/apollographql/apollo-client/issues"},"license":"MIT","readmeFilename":"","users":{"mjurincic":true,"pje":true,"mlrawlings":true,"ezraobiwale":true,"cr8tiv":true},"contributors":[{"name":"James Burgess","email":"jamesmillerburgess@gmail.com"}]}