Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1# Changelog
2
3## 3.0.0
4
5### Patch Changes
6
7- Updated dependencies (See [#3789](https://github.com/urql-graphql/urql/pull/3789) and [#3807](https://github.com/urql-graphql/urql/pull/3807))
8 - @urql/core@6.0.0
9
10## 2.2.1
11
12### Patch Changes
13
14- Omit minified files and sourcemaps' `sourcesContent` in published packages
15 Submitted by [@kitten](https://github.com/kitten) (See [#3755](https://github.com/urql-graphql/urql/pull/3755))
16- Updated dependencies (See [#3755](https://github.com/urql-graphql/urql/pull/3755))
17 - @urql/core@5.1.1
18
19## 2.2.0
20
21### Minor Changes
22
23- Mark `@urql/core` as a peer dependency as well as a regular dependency
24 Submitted by [@kitten](https://github.com/kitten) (See [#3579](https://github.com/urql-graphql/urql/pull/3579))
25
26## 2.1.6
27
28### Patch Changes
29
30- `authExchange()` will now block and pass on errors if the initialization function passed to it fails, and will retry indefinitely. It’ll also output a warning for these cases, as the initialization function (i.e. `authExchange(async (utils) => { /*...*/ })`) is not expected to reject/throw
31 Submitted by [@kitten](https://github.com/kitten) (See [#3343](https://github.com/urql-graphql/urql/pull/3343))
32
33## 2.1.5
34
35### Patch Changes
36
37- Handle `refreshAuth` rejections and pass the resulting error on to `OperationResult`s on the authentication queue
38 Submitted by [@kitten](https://github.com/kitten) (See [#3307](https://github.com/urql-graphql/urql/pull/3307))
39
40## 2.1.4
41
42### Patch Changes
43
44- ⚠️ Fix regression that caused teardowns to be ignored by an `authExchange`’s retry queue
45 Submitted by [@kitten](https://github.com/kitten) (See [#3235](https://github.com/urql-graphql/urql/pull/3235))
46
47## 2.1.3
48
49### Patch Changes
50
51- Update build process to generate correct source maps
52 Submitted by [@kitten](https://github.com/kitten) (See [#3201](https://github.com/urql-graphql/urql/pull/3201))
53
54## 2.1.2
55
56### Patch Changes
57
58- Publish with npm provenance
59 Submitted by [@kitten](https://github.com/kitten) (See [#3180](https://github.com/urql-graphql/urql/pull/3180))
60
61## 2.1.1
62
63### Patch Changes
64
65- ⚠️ Fix operations created by `utilities.mutate()` erroneously being retried and sent again like a regular operation
66 Submitted by [@JoviDeCroock](https://github.com/JoviDeCroock) (See [#3164](https://github.com/urql-graphql/urql/pull/3164))
67
68## 2.1.0
69
70### Minor Changes
71
72- Update exchanges to drop redundant `share` calls, since `@urql/core`’s `composeExchanges` utility now automatically does so for us
73 Submitted by [@kitten](https://github.com/kitten) (See [#3082](https://github.com/urql-graphql/urql/pull/3082))
74
75### Patch Changes
76
77- ⚠️ Fix source maps included with recently published packages, which lost their `sourcesContent`, including additional source files, and had incorrect paths in some of them
78 Submitted by [@kitten](https://github.com/kitten) (See [#3053](https://github.com/urql-graphql/urql/pull/3053))
79- Upgrade to `wonka@^6.3.0`
80 Submitted by [@kitten](https://github.com/kitten) (See [#3104](https://github.com/urql-graphql/urql/pull/3104))
81- Avoid infinite loop when `didAuthError` keeps returning true
82 Submitted by [@JoviDeCroock](https://github.com/JoviDeCroock) (See [#3112](https://github.com/urql-graphql/urql/pull/3112))
83- Updated dependencies (See [#3101](https://github.com/urql-graphql/urql/pull/3101), [#3033](https://github.com/urql-graphql/urql/pull/3033), [#3054](https://github.com/urql-graphql/urql/pull/3054), [#3053](https://github.com/urql-graphql/urql/pull/3053), [#3060](https://github.com/urql-graphql/urql/pull/3060), [#3081](https://github.com/urql-graphql/urql/pull/3081), [#3039](https://github.com/urql-graphql/urql/pull/3039), [#3104](https://github.com/urql-graphql/urql/pull/3104), [#3082](https://github.com/urql-graphql/urql/pull/3082), [#3097](https://github.com/urql-graphql/urql/pull/3097), [#3061](https://github.com/urql-graphql/urql/pull/3061), [#3055](https://github.com/urql-graphql/urql/pull/3055), [#3085](https://github.com/urql-graphql/urql/pull/3085), [#3079](https://github.com/urql-graphql/urql/pull/3079), [#3087](https://github.com/urql-graphql/urql/pull/3087), [#3059](https://github.com/urql-graphql/urql/pull/3059), [#3055](https://github.com/urql-graphql/urql/pull/3055), [#3057](https://github.com/urql-graphql/urql/pull/3057), [#3050](https://github.com/urql-graphql/urql/pull/3050), [#3062](https://github.com/urql-graphql/urql/pull/3062), [#3051](https://github.com/urql-graphql/urql/pull/3051), [#3043](https://github.com/urql-graphql/urql/pull/3043), [#3063](https://github.com/urql-graphql/urql/pull/3063), [#3054](https://github.com/urql-graphql/urql/pull/3054), [#3102](https://github.com/urql-graphql/urql/pull/3102), [#3097](https://github.com/urql-graphql/urql/pull/3097), [#3106](https://github.com/urql-graphql/urql/pull/3106), [#3058](https://github.com/urql-graphql/urql/pull/3058), and [#3062](https://github.com/urql-graphql/urql/pull/3062))
84 - @urql/core@4.0.0
85
86## 2.0.0
87
88### Major Changes
89
90- Implement new `authExchange` API, which removes the need for an `authState` (i.e. an internal authentication state) and removes `getAuth`, replacing it with a separate `refreshAuth` flow.
91 The new API requires you to now pass an initializer function. This function receives a `utils`
92 object with `utils.mutate` and `utils.appendHeaders` utility methods.
93 It must return the configuration object, wrapped in a promise, and this configuration is similar to
94 what we had before, if you're migrating to this. Its `refreshAuth` method is now only called after
95 authentication errors occur and not on initialization. Instead, it's now recommended that you write
96 your initialization logic in-line.
97 ```js
98 authExchange(async utils => {
99 let token = localStorage.getItem('token');
100 let refreshToken = localStorage.getItem('refreshToken');
101 return {
102 addAuthToOperation(operation) {
103 return utils.appendHeaders(operation, {
104 Authorization: `Bearer ${token}`,
105 });
106 },
107 didAuthError(error) {
108 return error.graphQLErrors.some(
109 e => e.extensions?.code === 'FORBIDDEN'
110 );
111 },
112 async refreshAuth() {
113 const result = await utils.mutate(REFRESH, { token });
114 if (result.data?.refreshLogin) {
115 token = result.data.refreshLogin.token;
116 refreshToken = result.data.refreshLogin.refreshToken;
117 localStorage.setItem('token', token);
118 localStorage.setItem('refreshToken', refreshToken);
119 }
120 },
121 };
122 });
123 ```
124 Submitted by [@kitten](https://github.com/kitten) (See [#3012](https://github.com/urql-graphql/urql/pull/3012))
125
126### Patch Changes
127
128- ⚠️ Fix `willAuthError` not being called for operations that are waiting on the authentication state to update. This can actually lead to a common issue where operations that came in during the authentication initialization (on startup) will never have `willAuthError` called on them. This can cause an easy mistake where the initial authentication state is never checked to be valid
129 Submitted by [@kitten](https://github.com/kitten) (See [#3017](https://github.com/urql-graphql/urql/pull/3017))
130- Updated dependencies (See [#3007](https://github.com/urql-graphql/urql/pull/3007), [#2962](https://github.com/urql-graphql/urql/pull/2962), [#3007](https://github.com/urql-graphql/urql/pull/3007), [#3015](https://github.com/urql-graphql/urql/pull/3015), and [#3022](https://github.com/urql-graphql/urql/pull/3022))
131 - @urql/core@3.2.0
132
133## 1.0.0
134
135### Major Changes
136
137- **Goodbye IE11!** 👋 This major release removes support for IE11. All code that is shipped will be transpiled much less and will _not_ be ES5-compatible anymore, by [@kitten](https://github.com/kitten) (See [#2504](https://github.com/FormidableLabs/urql/pull/2504))
138- Upgrade to [Wonka v6](https://github.com/0no-co/wonka) (`wonka@^6.0.0`), which has no breaking changes but is built to target ES2015 and comes with other minor improvements.
139 The library has fully been migrated to TypeScript which will hopefully help with making contributions easier!, by [@kitten](https://github.com/kitten) (See [#2504](https://github.com/FormidableLabs/urql/pull/2504))
140
141### Minor Changes
142
143- Remove the `babel-plugin-modular-graphql` helper, this because the graphql package hasn't converted to ESM yet which gives issues in node environments, by [@JoviDeCroock](https://github.com/JoviDeCroock) (See [#2551](https://github.com/FormidableLabs/urql/pull/2551))
144
145### Patch Changes
146
147- Updated dependencies (See [#2551](https://github.com/FormidableLabs/urql/pull/2551), [#2504](https://github.com/FormidableLabs/urql/pull/2504), [#2619](https://github.com/FormidableLabs/urql/pull/2619), [#2607](https://github.com/FormidableLabs/urql/pull/2607), and [#2504](https://github.com/FormidableLabs/urql/pull/2504))
148 - @urql/core@3.0.0
149
150## 0.1.7
151
152### Patch Changes
153
154- Extend peer dependency range of `graphql` to include `^16.0.0`.
155 As always when upgrading across many packages of `urql`, especially including `@urql/core` we recommend you to deduplicate dependencies after upgrading, using `npm dedupe` or `npx yarn-deduplicate`, by [@kitten](https://github.com/kitten) (See [#2133](https://github.com/FormidableLabs/urql/pull/2133))
156- Updated dependencies (See [#2133](https://github.com/FormidableLabs/urql/pull/2133))
157 - @urql/core@2.3.6
158
159## 0.1.6
160
161### Patch Changes
162
163- ⚠️ Fix willAuthError causing duplicate operations, by [@yankovalera](https://github.com/yankovalera) (See [#1849](https://github.com/FormidableLabs/urql/pull/1849))
164- Updated dependencies (See [#1851](https://github.com/FormidableLabs/urql/pull/1851), [#1850](https://github.com/FormidableLabs/urql/pull/1850), and [#1852](https://github.com/FormidableLabs/urql/pull/1852))
165 - @urql/core@2.2.0
166
167## 0.1.5
168
169### Patch Changes
170
171- Expose `AuthContext` type, by [@arempe93](https://github.com/arempe93) (See [#1828](https://github.com/FormidableLabs/urql/pull/1828))
172- Updated dependencies (See [#1829](https://github.com/FormidableLabs/urql/pull/1829))
173 - @urql/core@2.1.6
174
175## 0.1.4
176
177### Patch Changes
178
179- Allow `mutate` to infer the result's type when a `TypedDocumentNode` is passed via the usual generics, like `client.mutation` for instance, by [@younesmln](https://github.com/younesmln) (See [#1796](https://github.com/FormidableLabs/urql/pull/1796))
180
181## 0.1.3
182
183### Patch Changes
184
185- Remove closure-compiler from the build step (See [#1570](https://github.com/FormidableLabs/urql/pull/1570))
186- Updated dependencies (See [#1570](https://github.com/FormidableLabs/urql/pull/1570), [#1509](https://github.com/FormidableLabs/urql/pull/1509), [#1600](https://github.com/FormidableLabs/urql/pull/1600), and [#1515](https://github.com/FormidableLabs/urql/pull/1515))
187 - @urql/core@2.1.0
188
189## 0.1.2
190
191### Patch Changes
192
193- Deprecate the `Operation.operationName` property in favor of `Operation.kind`. This name was
194 previously confusing as `operationName` was effectively referring to two different things. You can
195 safely upgrade to this new version, however to mute all deprecation warnings you will have to
196 **upgrade** all `urql` packages you use. If you have custom exchanges that spread operations, please
197 use [the new `makeOperation` helper
198 function](https://formidable.com/open-source/urql/docs/api/core/#makeoperation) instead, by [@bkonkle](https://github.com/bkonkle) (See [#1045](https://github.com/FormidableLabs/urql/pull/1045))
199- Updated dependencies (See [#1094](https://github.com/FormidableLabs/urql/pull/1094) and [#1045](https://github.com/FormidableLabs/urql/pull/1045))
200 - @urql/core@1.14.0
201
202## 0.1.1
203
204### Patch Changes
205
206- ⚠️ Fix an operation that triggers `willAuthError` with a truthy return value being sent off twice, by [@kitten](https://github.com/kitten) (See [#1075](https://github.com/FormidableLabs/urql/pull/1075))
207
208## v0.1.0
209
210**Initial Release**