{"_id":"@appsignal/urql","_rev":"3-4ce8b48fa2719b1c30d439625161be8c","name":"@appsignal/urql","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@appsignal/urql","version":"1.0.0","license":"MIT","_id":"@appsignal/urql@1.0.0","maintainers":[{"name":"matsimitsu","email":"robert@appsignal.com"},{"name":"jvanbaarsen","email":"jeroenvanbaarsen@gmail.com"},{"name":"thijsc","email":"thijs@appsignal.com"},{"name":"tombruijn","email":"tom@tomdebruijn.com"},{"name":"as_unflxw","email":"noemi@appsignal.com"},{"name":"martinlipskis","email":"martin@appsignal.com"}],"homepage":"https://github.com/appsignal/appsignal-javascript#readme","bugs":{"url":"https://github.com/appsignal/appsignal-javascript/issues"},"dist":{"shasum":"f2865b15997eb80af72e580c79782c97c38641ce","tarball":"https://registry.npmjs.org/@appsignal/urql/-/urql-1.0.0.tgz","fileCount":18,"integrity":"sha512-jjw/XADoxHKc5iyt+0PQDNQptp75H/r2Mkgy7wLvFXuAWMJ3Iw9WDXVQcL1rpIDQDVLPANK6wwoocLgEb1ykyw==","signatures":[{"sig":"MEUCIQC0135XJSTcyJdzaT5yeoVlescZ1IfhPUO/ra39ljsjEwIgBBdki1PZ8JYbO6lpIMzHBKnE/xNK93rRz4QSOVDEXkc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23373},"main":"dist/cjs/index.js","types":"./dist/cjs/index.d.ts","module":"dist/esm/index.js","gitHead":"40bfeef06b7d08c8da1b855b484e4ec0ef7c209f","scripts":{"test":"jest --passWithNoTests","build":"npm run build:cjs && npm run build:esm","clean":"rimraf dist coverage","link:npm":"npm link","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json","test:watch":"jest --watch","build:watch":"run-p build:cjs:watch build:esm:watch","build:cjs:watch":"tsc -p tsconfig.cjs.json -w --preserveWatchOutput","build:esm:watch":"tsc -p tsconfig.esm.json -w --preserveWatchOutput"},"_npmUser":{"name":"martinlipskis","email":"martin@appsignal.com"},"repository":{"url":"git+https://github.com/appsignal/appsignal-javascript.git","type":"git","directory":"packages/urql"},"_npmVersion":"11.4.2","description":"- [AppSignal.com website][appsignal] - [Documentation][docs] - [Support][contact]","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@appsignal/javascript":"=1.6.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"urql":">= 2.0.0 < 5","wonka":">= 4.0.0 < 7"},"_npmOperationalInternal":{"tmp":"tmp/urql_1.0.0_1776784123964_0.08362888023626391","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-04-21T15:08:43.891Z","modified":"2026-09-10T10:18:14.154Z","1.0.0":"2026-04-21T15:08:44.095Z"},"bugs":{"url":"https://github.com/appsignal/appsignal-javascript/issues"},"license":"MIT","homepage":"https://github.com/appsignal/appsignal-javascript#readme","repository":{"url":"git+https://github.com/appsignal/appsignal-javascript.git","type":"git","directory":"packages/urql"},"description":"- [AppSignal.com website][appsignal] - [Documentation][docs] - [Support][contact]","maintainers":[{"email":"robert@appsignal.com","name":"matsimitsu"},{"email":"jeroenvanbaarsen@gmail.com","name":"jvanbaarsen"},{"email":"thijs@appsignal.com","name":"thijsc"},{"email":"tom@tomdebruijn.com","name":"tombruijn"},{"email":"noemi@appsignal.com","name":"as_unflxw"},{"email":"brunjact@protonmail.com","name":"brunjact"},{"email":"anton@appsignal.com","name":"anton.kalinin"},{"email":"martin@appsignal.com","name":"martinlipskis"}],"readme":"# `@appsignal/urql`\n\n- [AppSignal.com website][appsignal]\n- [Documentation][docs]\n- [Support][contact]\n\nThe `@appsignal/javascript` integration for urql GraphQL client.\n\nSee also the [mono repo README](../../README.md) for more information.\n\n## Installation\n\nAdd the  `@appsignal/urql` and `@appsignal/javascript` packages to your `package.json`. Then, run `yarn install`/`npm install`.\n\nYou can also add these packages to your `package.json` on the command line:\n\n```\nyarn add @appsignal/javascript @appsignal/urql urql wonka\nnpm install --save @appsignal/javascript @appsignal/urql urql wonka\n```\n\n## Usage\n\n### Urql Exchange\n\nThe `@appsignal/urql` package provides a custom urql exchange that automatically reports GraphQL errors to AppSignal. This exchange intercepts all query and mutation results and reports any errors without requiring changes to individual `useQuery` calls.\n\n```typescript\nimport { createClient, fetchExchange } from 'urql';\nimport Appsignal from '@appsignal/javascript';\nimport { createAppsignalExchange } from '@appsignal/urql';\n\nconst appsignal = new Appsignal({\n  key: 'YOUR FRONTEND API KEY'\n});\n\nconst client = createClient({\n  url: 'https://api.example.com/graphql',\n  exchanges: [createAppsignalExchange(appsignal), fetchExchange]\n});\n```\n\nThe exchange will automatically:\n- Report all GraphQL errors to AppSignal\n- Include the GraphQL query body as a parameter (visible in AppSignal's error details)\n- Include the endpoint URL as a tag\n- Include operation name and type as tags (when available)\n\n### Error Details\n\nWhen a GraphQL error occurs, AppSignal will receive:\n\n- **Error message**: A concatenation of all GraphQL error messages\n- **Tags**:\n  - `endpoint`: The GraphQL endpoint URL\n  - `operationName`: The name of the GraphQL operation (if specified)\n  - `operationType`: The type of operation (query, mutation, subscription)\n- **Parameters**:\n  - `query`: The full GraphQL query body\n\nThis provides complete context for debugging GraphQL errors in your application.\n\n## Development\n\n### Installation\n\nMake sure mono is installed and bootstrapped, see the [project README's development section](../../README.md#dev-install) for more information.\n\nYou can then run the following to start the compiler in _watch_ mode. This automatically compiles both the ES Module and CommonJS variants:\n\n```bash\nyarn build:watch\n```\n\nYou can also build the library without watching the directory:\n\n```\nyarn build        # build both CJS and ESM\nyarn build:cjs    # just CJS\nyarn build:esm    # just ESM\n```\n\n### Testing\n\nThe tests for this library use [Jest](https://jestjs.io) as the test runner. Once you've installed the dependencies, you can run the following command in the root of this repository to run the tests for all packages, or in the directory of a package to run only the tests pertaining to that package:\n\n```bash\nyarn test\n```\n\n### Versioning\n\nThis repo uses [Semantic Versioning][semver] (often referred to as _semver_). Each package in the repository is versioned independently from one another.\n\n## Contributing\n\nThinking of contributing to this repo? Awesome! 🚀\n\nPlease follow our [Contributing guide][contributing-guide] in our documentation and follow our [Code of Conduct][coc].\n\nAlso, we would be very happy to send you Stroopwafles. Have look at everyone we send a package to so far on our [Stroopwafles page][waffles-page].\n\n## Support\n\n[Contact us][contact] and speak directly with the engineers working on AppSignal. They will help you get set up, tweak your code and make sure you get the most out of using AppSignal.\n\n[appsignal]: https://appsignal.com\n[appsignal-sign-up]: https://appsignal.com/users/sign_up\n[contact]: mailto:support@appsignal.com\n[coc]: https://docs.appsignal.com/appsignal/code-of-conduct.html\n[waffles-page]: https://appsignal.com/waffles\n[docs]: http://docs.appsignal.com\n[contributing-guide]: http://docs.appsignal.com/appsignal/contributing.html\n\n[semver]: http://semver.org/\n","readmeFilename":"README.md"}