{"_id":"@asayerio/tracker-graphql","_rev":"6-e4ee6641225cfd816ac896fd0de6c182","name":"@asayerio/tracker-graphql","dist-tags":{"latest":"5.7.0"},"versions":{"5.0.0":{"name":"@asayerio/tracker-graphql","description":"Tracker plugin for GraphQL requests recording","version":"5.0.0","keywords":["graphql","logging","replay"],"author":{"name":"Alex Tsokurov"},"license":"MIT","type":"module","main":"./lib/index.js","scripts":{"lint":"prettier --write 'src/**/*.ts' README.md && tsc --noEmit","build":"tsc","prepublishOnly":"rm -Rf lib && npm run build"},"peerDependencies":{"@asayerio/tracker":"^5.1.0"},"devDependencies":{"prettier":"^1.18.2","typescript":"^3.6.4"},"repository":{"type":"git","url":"git+https://github.com/asayerio/tracker-graphql.git"},"bugs":{"url":"https://github.com/asayerio/tracker-graphql/issues"},"homepage":"https://github.com/asayerio/tracker-graphql#readme","_id":"@asayerio/tracker-graphql@5.0.0","_nodeVersion":"12.18.1","_npmVersion":"6.14.5","dist":{"integrity":"sha512-iyQoipK1EJu4xEOOZESZmjjdYkPwcyWkGI06WePrX5Utpv1QHdOBKKd2l9p5HzOPqEs8KGhTyEI32LPJPQnszA==","shasum":"bac2e42286ced91cbd913b9fde454b290724721a","tarball":"https://registry.npmjs.org/@asayerio/tracker-graphql/-/tracker-graphql-5.0.0.tgz","fileCount":5,"unpackedSize":4945,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfN9MACRA9TVsSAnZWagAAQMQP+gPhXr8K8NRXcTWJbwb+\ncGr9V3i95leVNQeG9CPyrZcTfjgXj5ynihXZono68t5MMM+hgvEZiJTDj+F9\n3Yct0i9Ig88VJVA3aOnupvFXBqHLlK/X9VDXKmRju0ttqoefYU3jcvZEvsUe\n7vx9g1+x3INL7vVVODemx0Drles181IMRCAiB7Vq48kbDT9lfuUFai5/VHth\nT9GJty+iogl28CaB9eH+9H6JV1JPWPoTmL0nos6ovnC4lGTves/K5B2pZxFj\nWZw8gUl8hCSQ4QnoIqzY6XHT+bTud0xzbwV6WZjOavaP55yl1IWsLY7GkyY3\nohY9u/xan8iDPfnWPiYKsqqm9IDH4k8ianMEzAZINsH60KdCwaaFVpmkMVi0\n0aqb3vreqqVTRx4iioPI8RxDRIX1fMh9/oEr8Z2hg5Vx5NEXTzq8zCQqdHDL\nrIaen9g0oTudF5OKNWZ6f2ip8g+sg+kkMGM14btiMLPTRY44HLSWdiST8IHU\nAM7RYPWH6Bm7qCe4IKzljK9cNDed6NPMWFDTr4IGtUnrGUCFl7Kh+5ik8qjk\nheW2IyoofQOkDnSMaxAppJoyj2cUOGd/nJUXZbwb98qpz/X1pmU+wgbNjAeB\nWTQ94UPaaac8TgW2SoDrrV4xLqRQo/+CpP0krOG7Wvgl5JS4eg7VdfRa07ny\nz/zO\r\n=5vr+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCiW0ZyDRnCiXMl6Kg0Out2uXnl87of9JTmH5Yqsx/BHAIhAPMwqrzFpin4TETtmGxeKpoigZWnsRAPKj9VIm0dlbQs"}]},"maintainers":[{"name":"pandacodes","email":"alex.kaminsky.11@gmail.com"},{"name":"tahayk","email":"tahayk2@gmail.com"},{"name":"estradino","email":"support@asayer.io"}],"_npmUser":{"name":"pandacodes","email":"alex.kaminsky.11@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracker-graphql_5.0.0_1597494015972_0.1897216198135434"},"_hasShrinkwrap":false,"deprecated":"This package is no longer maintained. Please, use @openreplay/tracker and @openreplay/tracker-graphql instead"},"5.7.0":{"name":"@asayerio/tracker-graphql","description":"Tracker plugin for GraphQL requests recording","version":"5.7.0","keywords":["graphql","logging","replay"],"author":{"name":"Alex Tsokurov"},"contributors":[{"name":"Aleksandr Kaminskii","email":"akaminsky@asayer.io"}],"license":"MIT","type":"module","main":"./lib/index.js","scripts":{"lint":"prettier --write 'src/**/*.ts' README.md && tsc --noEmit","build":"npm run build-es && npm run build-cjs","build-es":"rm -Rf lib && tsc","build-cjs":"rm -Rf cjs && tsc --project tsconfig-cjs.json && echo '{ \"type\": \"commonjs\" }' > cjs/package.json && replace-in-files cjs/* --string='@asayerio/tracker' --replacement='@asayerio/tracker/cjs'","prepublishOnly":"npm run build"},"peerDependencies":{"@asayerio/tracker":"^5.1.0"},"devDependencies":{"prettier":"^1.18.2","replace-in-files-cli":"^1.0.0","typescript":"^3.6.4"},"repository":{"type":"git","url":"git+https://github.com/asayerio/tracker-graphql.git"},"bugs":{"url":"https://github.com/asayerio/tracker-graphql/issues"},"homepage":"https://github.com/asayerio/tracker-graphql#readme","gitHead":"8c47a3654a58aa6210f24e5a1127ddfa541a1e34","_id":"@asayerio/tracker-graphql@5.7.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-FbqxSrJRELrm1DJbkL/KL8yxoqIobu0jzQ3X6eQtcCEZ2ldoaYse/aokytm62J8jai0nCScjy9D3Te2OsbLy4w==","shasum":"606b2495ddb73650cf457bf555702a6f5c1a538d","tarball":"https://registry.npmjs.org/@asayerio/tracker-graphql/-/tracker-graphql-5.7.0.tgz","fileCount":8,"unpackedSize":5964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh117rCRA9TVsSAnZWagAAO1wP/2olnnLyxNC9CBEtuYS2\nDl8EZx/HpYV45ghkNZZEBoDYZVtXUM0WqSf5bK9CsywBS5/jYdPxua6XRmSR\nbkKkNC3F7cb78zWigB33MwA2Ceqpsfa8FGgDgPjb6YJEPAlVNg3M9HO3lTRN\nZT22FwTgdXEtLe+dolxlcsVLejTOkAVYFhfhvNGOiSgXXzZQlKo+N294oYEE\nuudFRa4yw7TOS8eyE049RA4UXWHCDeWVNJnNYE3kMonFo5P/iw4PW2/98DSZ\nESDP+iMStHUkzcaC/VJHMsW9r3vwjXZGWUOJj8Tm5fdsW/XTqPm4f8ho0nl1\nWSxr1QmCLFkkDziqeqo6n3y4VxS9umxiukNc+tFKzovsWfdS32QoagvPsZnR\n2MymOAMADYGeCF98Aixj/1+n1ZcFIJtAokRDQNMsjhght4fXGn47pepLOYqh\nu71QKFA2/0RjlQKWgtcoCGU1XkNBZLZJ9uXOkB5zqBaqyqTA3fche61MKZYM\nHG7e7VtxvrioCWuw6Rt15MtFdyICKAKL0veHDWmBlazhL0rKvWL6n7oRzpi4\nSWZKeLy3f/RiKsxooVwZOpgfKTTfKRHvCZI+d4kTBvCZhjadZurl/FIn0mfS\nLuaW9+F9sjQqNdRtiq0V2GtUZYnuHJQ7ON3kuLO1gDMRz76UxxaC7QTebbPD\nWe4V\r\n=tNYP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1mkniEqArJK0a/jkZYAYZhSEZT1DsyIjtE4eHwja0wgIhAP4j5uAHcmjNnOVCmavIzMOGjM6lHr5P92gbCdtA2DYu"}]},"_npmUser":{"name":"pandacodes","email":"alex.kaminsky.11@gmail.com"},"directories":{},"maintainers":[{"name":"estradino","email":"support@asayer.io"},{"name":"tahayk","email":"tahayk2@gmail.com"},{"name":"pandacodes","email":"alex.kaminsky.11@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracker-graphql_5.7.0_1618517638463_0.8695477473508397"},"_hasShrinkwrap":false,"deprecated":"This package is no longer maintained. Please, use @openreplay/tracker and @openreplay/tracker-graphql instead"}},"time":{"created":"2020-08-15T12:20:15.737Z","5.0.0":"2020-08-15T12:20:16.117Z","modified":"2022-08-15T16:00:20.249Z","5.7.0":"2021-04-15T20:13:58.590Z"},"maintainers":[{"email":"support@asayer.io","name":"estradino"}],"description":"Tracker plugin for GraphQL requests recording","homepage":"https://github.com/asayerio/tracker-graphql#readme","keywords":["graphql","logging","replay"],"repository":{"type":"git","url":"git+https://github.com/asayerio/tracker-graphql.git"},"author":{"name":"Alex Tsokurov"},"bugs":{"url":"https://github.com/asayerio/tracker-graphql/issues"},"license":"MIT","readme":"# Asayer Tracker GraphQL plugin\n\nThis plugin allows you to capture the GraphQL requests and then search by them.\n\n## Installation\n\n```bash\nnpm i @asayerio/tracker-graphql --save\n```\n\n## Usage\n\nInitialize the `@asayerio/tracker` package as usual and load the plugin into it.\nThe `plugin` call will return the function, which receives four variables\n`operationKind`, `operationName`, `variables`, `result`\nand returns `result` without changes.\n\n```js\nimport Tracker from '@asayerio/tracker';\nimport trackerGraphQL from '@asayerio/tracker-graphql';\n\nconst tracker = new Tracker({\n  projectID: PROJECT_ID,\n});\n\nexport const recordGraphQL = tracker.plugin(trackerGraphQL());\n```\n\n### Relay\n\nFor [Relay](https://relay.dev/) you should manually put `recordGraphQL` call\nto the `NetworkLayer` implementation. If you are standard `Network.create` way to implement it,\nthen you should do something like below\n\n```js\nimport { recordGraphQL } from 'tracker'; // see above for recordGraphQL definition\nimport { Environment } from 'relay-runtime';\n\nfunction fetchQuery(operation, variables, cacheConfig, uploadables) {\n  return fetch('ENDPOINT', {\n    // ...\n  })\n    .then(response => response.json())\n    .then(result =>\n      recordGraphQL(operation.operationKind, operation.name, variables, result),\n    );\n}\n\nconst network = Network.create(fetchQuery);\n```\n\nSee [Relay Network Layer](https://relay.dev/docs/en/network-layer) for details.\n\n### Apollo\n\nFor [Apollo](https://www.apollographql.com/) you should create a new `ApolloLink` with\n`recordGraphQL` call and put it to your chain like below\n\n```js\nimport { recordGraphQL } from 'tracker'; // see above for recordGraphQL definition\nimport { ApolloLink } from 'apollo-link';\n\nconst trackerApolloLink = new ApolloLink((operation, forward) => {\n  return forward(operation).map(result =>\n    recordGraphQL(\n      operation.query.definitions[0].operation,\n      operation.operationName,\n      operation.variables,\n      result,\n    ),\n  );\n});\n\nconst link = ApolloLink.from([\n  trackerApolloLink,\n  // ...\n]);\n```\n\nSee [Apollo Link](https://www.apollographql.com/docs/link/) and\n[Apollo Networking](https://www.apollographql.com/docs/react/networking/network-layer/)\nfor details.\n","readmeFilename":"README.md","contributors":[{"name":"Aleksandr Kaminskii","email":"akaminsky@asayer.io"}]}