{"_id":"graphql-client","_rev":"3816337","name":"graphql-client","description":"Small http client based on the fetch api. Uses isomorphic-fetch for wider support","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"nordsimon","email":""},{"name":"simon.nord","email":""}],"time":{"modified":"2025-06-05T11:30:01.000Z","created":"2016-01-18T19:02:13.051Z","2.0.1":"2018-02-15T16:44:04.198Z","2.0.0":"2017-09-07T08:19:11.657Z","1.1.0":"2016-07-24T21:44:57.076Z","1.0.4":"2016-05-24T19:19:01.000Z","1.0.3":"2016-01-19T09:42:02.833Z","1.0.2":"2016-01-19T08:29:05.215Z","1.0.1":"2016-01-18T19:06:11.022Z","1.0.0":"2016-01-18T19:02:13.051Z"},"users":{},"author":"","repository":{"type":"git","url":"git+https://github.com/nordsimon/graphql-client.git"},"versions":{"2.0.1":{"name":"graphql-client","version":"2.0.1","description":"Small http client based on the fetch api. Uses isomorphic-fetch for wider support","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nordsimon/graphql-client.git"},"keywords":[],"author":"","license":"ISC","dependencies":{"isomorphic-fetch":"^2.2.1"},"gitHead":"7d7b7dcb8a7f3aaec01d48ed0998d5e46689d452","bugs":{"url":"https://github.com/nordsimon/graphql-client/issues"},"homepage":"https://github.com/nordsimon/graphql-client#readme","_id":"graphql-client@2.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"nordsimon","email":"simon@nord.org"},"dist":{"shasum":"d4a85a9fd2b04a0ef732e242250fac132579a4da","size":1534,"noattachment":false,"key":"/graphql-client/-/graphql-client-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-client/download/graphql-client-2.0.1.tgz"},"maintainers":[{"name":"nordsimon","email":""},{"name":"simon.nord","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-client_2.0.1_1518713043540_0.6306809759768293"},"_hasShrinkwrap":false,"publish_time":1518713044198,"_cnpm_publish_time":1518713044198,"_cnpmcore_publish_time":"2021-12-18T21:03:15.262Z"},"2.0.0":{"name":"graphql-client","version":"2.0.0","description":"Small http client based on the fetch api. Uses isomorphic-fetch for wider support","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nordsimon/graphql-client.git"},"keywords":[],"author":"","license":"ISC","dependencies":{"isomorphic-fetch":"^2.2.1"},"gitHead":"2286146f2c78c8ca47c2f3260132ed4aef21f10a","bugs":{"url":"https://github.com/nordsimon/graphql-client/issues"},"homepage":"https://github.com/nordsimon/graphql-client#readme","_id":"graphql-client@2.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"nordsimon","email":"simon@nord.org"},"dist":{"shasum":"870364baba3f7da4a60d60d7a918cc49898ea162","size":1596,"noattachment":false,"key":"/graphql-client/-/graphql-client-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-client/download/graphql-client-2.0.0.tgz"},"maintainers":[{"name":"nordsimon","email":""},{"name":"simon.nord","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-client-2.0.0.tgz_1504772350758_0.8462218309286982"},"directories":{},"publish_time":1504772351657,"_hasShrinkwrap":false,"_cnpm_publish_time":1504772351657,"_cnpmcore_publish_time":"2021-12-18T21:03:15.558Z"},"1.1.0":{"name":"graphql-client","version":"1.1.0","description":"Small http client based on the fetch api. Uses isomorphic-fetch for wider support","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nordsimon/graphql-client.git"},"keywords":[],"author":"","license":"ISC","dependencies":{"isomorphic-fetch":"2.2.1"},"gitHead":"0d36b7484b4f352253e3bc52a50fa1e1f8b38216","bugs":{"url":"https://github.com/nordsimon/graphql-client/issues"},"homepage":"https://github.com/nordsimon/graphql-client#readme","_id":"graphql-client@1.1.0","_shasum":"694187605c6accd4bf32393b9c0727b1f5d0397b","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.1.0","_npmUser":{"name":"nordsimon","email":"simon@nord.org"},"dist":{"shasum":"694187605c6accd4bf32393b9c0727b1f5d0397b","size":1695,"noattachment":false,"key":"/graphql-client/-/graphql-client-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-client/download/graphql-client-1.1.0.tgz"},"maintainers":[{"name":"nordsimon","email":""},{"name":"simon.nord","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/graphql-client-1.1.0.tgz_1469396695070_0.2597394101321697"},"directories":{},"publish_time":1469396697076,"_hasShrinkwrap":false,"_cnpm_publish_time":1469396697076,"_cnpmcore_publish_time":"2021-12-18T21:03:15.781Z"},"1.0.4":{"name":"graphql-client","version":"1.0.4","description":"Small http client based on the fetch api. Uses isomorphic-fetch for wider support","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nordsimon/graphql-client.git"},"keywords":[],"author":"","license":"ISC","dependencies":{"isomorphic-fetch":"^2.2.1"},"gitHead":"a908bccc6c06e4d015eb52b901adf1313d2b19c0","bugs":{"url":"https://github.com/nordsimon/graphql-client/issues"},"homepage":"https://github.com/nordsimon/graphql-client#readme","_id":"graphql-client@1.0.4","_shasum":"d442ca71a04595a94ecd51e4fffe41e98cef887e","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.1.0","_npmUser":{"name":"nordsimon","email":"simon@nord.org"},"dist":{"shasum":"d442ca71a04595a94ecd51e4fffe41e98cef887e","size":1386,"noattachment":false,"key":"/graphql-client/-/graphql-client-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-client/download/graphql-client-1.0.4.tgz"},"maintainers":[{"name":"nordsimon","email":""},{"name":"simon.nord","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/graphql-client-1.0.4.tgz_1464117539825_0.5570900598540902"},"directories":{},"publish_time":1464117541000,"_hasShrinkwrap":false,"_cnpm_publish_time":1464117541000,"_cnpmcore_publish_time":"2021-12-18T21:03:15.997Z"},"1.0.3":{"name":"graphql-client","version":"1.0.3","description":"Small http client based on the fetch api. Uses isomorphic-fetch for wider support","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nordsimon/graphql-client.git"},"keywords":[],"author":"","license":"ISC","dependencies":{"isomorphic-fetch":"^2.2.1"},"gitHead":"753dd3cc35015fdc5aa27e4c0b94d55aedcffec0","bugs":{"url":"https://github.com/nordsimon/graphql-client/issues"},"homepage":"https://github.com/nordsimon/graphql-client#readme","_id":"graphql-client@1.0.3","_shasum":"5cd159b7b4477dc794d7beaa15712f30b776ac7d","_from":".","_npmVersion":"3.5.0","_nodeVersion":"4.1.1","_npmUser":{"name":"simon.nord","email":"simon@nord.org"},"dist":{"shasum":"5cd159b7b4477dc794d7beaa15712f30b776ac7d","size":1386,"noattachment":false,"key":"/graphql-client/-/graphql-client-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-client/download/graphql-client-1.0.3.tgz"},"maintainers":[{"name":"nordsimon","email":""},{"name":"simon.nord","email":""}],"directories":{},"publish_time":1453196522833,"_hasShrinkwrap":false,"_cnpm_publish_time":1453196522833,"_cnpmcore_publish_time":"2021-12-18T21:03:16.212Z"},"1.0.2":{"name":"graphql-client","version":"1.0.2","description":"","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":"","license":"ISC","dependencies":{"isomorphic-fetch":"^2.2.1"},"gitHead":"9d0fe99b9a8b824d9a8819e7ba82cadf3a10371f","_id":"graphql-client@1.0.2","_shasum":"b949a5b47afdcdbc25ebe437d11c94ab8c5d9dff","_from":".","_npmVersion":"3.5.0","_nodeVersion":"4.1.1","_npmUser":{"name":"simon.nord","email":"simon@nord.org"},"dist":{"shasum":"b949a5b47afdcdbc25ebe437d11c94ab8c5d9dff","size":916,"noattachment":false,"key":"/graphql-client/-/graphql-client-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-client/download/graphql-client-1.0.2.tgz"},"maintainers":[{"name":"nordsimon","email":""},{"name":"simon.nord","email":""}],"directories":{},"publish_time":1453192145215,"_hasShrinkwrap":false,"_cnpm_publish_time":1453192145215,"_cnpmcore_publish_time":"2021-12-18T21:03:16.482Z"},"1.0.1":{"name":"graphql-client","version":"1.0.1","description":"","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":"","license":"ISC","gitHead":"fe1c547010e9824a847426b08421c631d89c49b2","_id":"graphql-client@1.0.1","_shasum":"5061da05b7590026e0a4e111813ac376ab062442","_from":".","_npmVersion":"3.5.0","_nodeVersion":"4.1.1","_npmUser":{"name":"simon.nord","email":"simon@nord.org"},"dist":{"shasum":"5061da05b7590026e0a4e111813ac376ab062442","size":838,"noattachment":false,"key":"/graphql-client/-/graphql-client-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-client/download/graphql-client-1.0.1.tgz"},"maintainers":[{"name":"nordsimon","email":""},{"name":"simon.nord","email":""}],"directories":{},"publish_time":1453143971022,"_hasShrinkwrap":false,"_cnpm_publish_time":1453143971022,"_cnpmcore_publish_time":"2021-12-18T21:03:16.689Z"},"1.0.0":{"name":"graphql-client","version":"1.0.0","description":"","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":"","license":"ISC","gitHead":"156020a786506e5284448c759ab8a79c1776b4f5","_id":"graphql-client@1.0.0","_shasum":"0f877587acddd27c18a0605bc40ad02926321aa1","_from":".","_npmVersion":"3.5.0","_nodeVersion":"4.1.1","_npmUser":{"name":"simon.nord","email":"simon@nord.org"},"dist":{"shasum":"0f877587acddd27c18a0605bc40ad02926321aa1","size":852,"noattachment":false,"key":"/graphql-client/-/graphql-client-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-client/download/graphql-client-1.0.0.tgz"},"maintainers":[{"name":"nordsimon","email":""},{"name":"simon.nord","email":""}],"directories":{},"publish_time":1453143733051,"_hasShrinkwrap":false,"_cnpm_publish_time":1453143733051,"_cnpmcore_publish_time":"2021-12-18T21:03:16.940Z"}},"readme":"# Simple GraphQL Client\nSmall http client based on the fetch api. Uses isomorphic-fetch for wider support\n\nIf query fails, errors are thrown with messages and query highlight for easy debug\n\n## Install\n```javascript\nnpm install graphql-client -S\n```\n\n## How To\n\nInitialize the client\n\n```javascript\nvar client = require('graphql-client')({\n  url: 'http://your-host/graphql',\n  headers: {\n    Authorization: 'Bearer ' + token\n  }\n})\n```\n\nUse the promise API\n\nWARNING: Make sure the Promise API is polyfilled for older browsers, you can use [es6-promise](https://github.com/jakearchibald/es6-promise)\n\n  ```javascript\n  var variables = {\n    query: \"Search Query\",\n    limit: 100,\n    from: 200\n  }\n\n  client.query(`\n  query search ($query: String, $from: Int, $limit: Int) {\n    search(query: $query, from: $from, limit: $limit) {\n      took,\n      totalHits,\n      hits {\n        name\n      }\n    }\n  }`, variables, function(req, res) {\n    if(res.status === 401) {\n      throw new Error('Not authorized')\n    }\n  })\n  .then(function(body) {\n    console.log(body)\n  })\n  .catch(function(err) {\n    console.log(err.message)\n  })\n  ```\n","_attachments":{},"homepage":"https://github.com/nordsimon/graphql-client#readme","bugs":{"url":"https://github.com/nordsimon/graphql-client/issues"},"license":"ISC"}