Skip to content

chore(toe): update graphql-toe and add instructions to README #3765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lucky-bears-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@urql/exchange-throw-on-error': patch
---

Update `graphql-toe` and add more detail to README.
16 changes: 14 additions & 2 deletions exchanges/throw-on-error/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# @urql/exchange-throw-on-error (Exchange factory)

`@urql/exchange-throw-on-error` is an exchange for the [`urql`](../../README.md) GraphQL client that makes field access to data throw an error if the field errored.
`@urql/exchange-throw-on-error` is an exchange for the [`urql`](https://github.com/urql-graphql/urql) GraphQL client that throws on field access to errored fields.

It is built on top of the [`graphql-toe`](https://github.com/graphile/graphql-toe) package.
It is built on top of the [`graphql-toe`](https://github.com/graphile/graphql-toe) package - please see that package for more information.

## Quick Start Guide

Expand All @@ -13,3 +13,15 @@ yarn add @urql/exchange-throw-on-error
# or
npm install --save @urql/exchange-throw-on-error
```

Then add the `throwOnErrorExchange`, to your client:

```js
import { createClient, cacheExchange, fetchExchange } from 'urql';
import { throwOnErrorExchange } from '@urql/exchange-throw-on-error';

const client = createClient({
url: '/graphql',
exchanges: [cacheExchange, throwOnErrorExchange(), fetchExchange],
});
```
2 changes: 1 addition & 1 deletion exchanges/throw-on-error/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
"dependencies": {
"@urql/core": "workspace:^5.1.1",
"graphql-toe": "0.1.2",
"graphql-toe": "^1.0.0-rc.0",
"wonka": "^6.3.2"
},
"publishConfig": {
Expand Down
12 changes: 5 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.