Skip to content

Commit 97b312a

Browse files
chore(release): update monorepo packages versions (#6283)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 7dcd0af commit 97b312a

File tree

3 files changed

+119
-96
lines changed

3 files changed

+119
-96
lines changed

.changeset/chilled-kids-flow.md

Lines changed: 0 additions & 83 deletions
This file was deleted.

packages/executor/CHANGELOG.md

Lines changed: 118 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,101 @@
11
# @graphql-tools/executor
22

3+
## 1.2.7
4+
5+
### Patch Changes
6+
7+
- [#6280](https://github.com/ardatan/graphql-tools/pull/6280)
8+
[`7dcd0af`](https://github.com/ardatan/graphql-tools/commit/7dcd0affcae14d8798426f3e2556b91a19df5986)
9+
Thanks [@ardatan](https://github.com/ardatan)! - Since the executor is version agnostic, it should
10+
respect the schemas created with older versions.
11+
12+
So if a type resolver returns a type instead of type name which is required since `graphql@16`,
13+
the executor should handle it correctly.
14+
15+
See the following example:
16+
17+
```ts
18+
// Assume that the following code is executed with `graphql@15`
19+
import { execute } from '@graphql-tools/executor'
20+
21+
const BarType = new GraphQLObjectType({
22+
name: 'Bar',
23+
fields: {
24+
bar: {
25+
type: GraphQLString,
26+
resolve: () => 'bar'
27+
}
28+
}
29+
})
30+
const BazType = new GraphQLObjectType({
31+
name: 'Baz',
32+
fields: {
33+
baz: {
34+
type: GraphQLString,
35+
resolve: () => 'baz'
36+
}
37+
}
38+
})
39+
const BarBazType = new GraphQLUnionType({
40+
name: 'BarBaz',
41+
types: [BarType, BazType],
42+
// This is the resolver that returns the type instead of type name
43+
resolveType(obj) {
44+
if ('bar' in obj) {
45+
return BarType
46+
}
47+
if ('baz' in obj) {
48+
return BazType
49+
}
50+
}
51+
})
52+
const QueryType = new GraphQLObjectType({
53+
name: 'Query',
54+
fields: {
55+
barBaz: {
56+
type: BarBazType,
57+
resolve: () => ({ bar: 'bar' })
58+
}
59+
}
60+
})
61+
const schema = new GraphQLSchema({
62+
query: QueryType
63+
})
64+
65+
const result = await execute({
66+
schema,
67+
document: parse(/* GraphQL */ `
68+
query {
69+
barBaz {
70+
... on Bar {
71+
bar
72+
}
73+
... on Baz {
74+
baz
75+
}
76+
}
77+
}
78+
`)
79+
})
80+
81+
expect(result).toEqual({
82+
data: {
83+
barBaz: {
84+
bar: 'bar'
85+
}
86+
}
87+
})
88+
```
89+
390
## 1.2.6
491

592
### Patch Changes
693

7-
- [#6038](https://github.com/ardatan/graphql-tools/pull/6038) [`02dd9ac`](https://github.com/ardatan/graphql-tools/commit/02dd9ac2ee92f6e390098a91753c1bcf5ef71cbc) Thanks [@ardatan](https://github.com/ardatan)! - Some libraries like `undici` throw objects that are not `Error` instances when the response is tried to parse as JSON but failed.
8-
In that case, executor prints an error like below;
94+
- [#6038](https://github.com/ardatan/graphql-tools/pull/6038)
95+
[`02dd9ac`](https://github.com/ardatan/graphql-tools/commit/02dd9ac2ee92f6e390098a91753c1bcf5ef71cbc)
96+
Thanks [@ardatan](https://github.com/ardatan)! - Some libraries like `undici` throw objects that
97+
are not `Error` instances when the response is tried to parse as JSON but failed. In that case,
98+
executor prints an error like below;
999

10100
```
11101
NonErrorThrown: Unexpected error value: {...}
@@ -17,43 +107,59 @@
17107
at async Promise.all (index 0)
18108
```
19109

20-
But actually the shape of the object matches the `Error` interface.
21-
In that case, the executor now coerces the object to an `Error` instance by taking `message`, `stack`, `name` and `cause` properties.
22-
So the user will get the error correctly.
110+
But actually the shape of the object matches the `Error` interface. In that case, the executor now
111+
coerces the object to an `Error` instance by taking `message`, `stack`, `name` and `cause`
112+
properties. So the user will get the error correctly.
23113

24114
## 1.2.5
25115

26116
### Patch Changes
27117

28-
- [#6020](https://github.com/ardatan/graphql-tools/pull/6020) [`b07be2b`](https://github.com/ardatan/graphql-tools/commit/b07be2b2f588345f85167776e8d31e976b110e1f) Thanks [@n1ru4l](https://github.com/n1ru4l)! - Correctly raise `AbortError` for defer payloads
118+
- [#6020](https://github.com/ardatan/graphql-tools/pull/6020)
119+
[`b07be2b`](https://github.com/ardatan/graphql-tools/commit/b07be2b2f588345f85167776e8d31e976b110e1f)
120+
Thanks [@n1ru4l](https://github.com/n1ru4l)! - Correctly raise `AbortError` for defer payloads
29121

30122
## 1.2.4
31123

32124
### Patch Changes
33125

34-
- [#6009](https://github.com/ardatan/graphql-tools/pull/6009) [`14a001e`](https://github.com/ardatan/graphql-tools/commit/14a001e7b82aa30371bb97c33cf0b5c145270ddf) Thanks [@n1ru4l](https://github.com/n1ru4l)! - correctly raise abort exception for Promise and sync execution
126+
- [#6009](https://github.com/ardatan/graphql-tools/pull/6009)
127+
[`14a001e`](https://github.com/ardatan/graphql-tools/commit/14a001e7b82aa30371bb97c33cf0b5c145270ddf)
128+
Thanks [@n1ru4l](https://github.com/n1ru4l)! - correctly raise abort exception for Promise and
129+
sync execution
35130

36131
## 1.2.3
37132

38133
### Patch Changes
39134

40-
- [#6006](https://github.com/ardatan/graphql-tools/pull/6006) [`a5364eb`](https://github.com/ardatan/graphql-tools/commit/a5364eb0723376ad67492369415e17c7d4568d77) Thanks [@n1ru4l](https://github.com/n1ru4l)! - fix rejecting when canceling async iterable returned from normalized executor
135+
- [#6006](https://github.com/ardatan/graphql-tools/pull/6006)
136+
[`a5364eb`](https://github.com/ardatan/graphql-tools/commit/a5364eb0723376ad67492369415e17c7d4568d77)
137+
Thanks [@n1ru4l](https://github.com/n1ru4l)! - fix rejecting when canceling async iterable
138+
returned from normalized executor
41139

42140
## 1.2.2
43141

44142
### Patch Changes
45143

46-
- [#5965](https://github.com/ardatan/graphql-tools/pull/5965) [`3e10da6`](https://github.com/ardatan/graphql-tools/commit/3e10da6b2bf97bdf40317a6d88a0cc6412fd0974) Thanks [@n1ru4l](https://github.com/n1ru4l)! - revert subscription event source error handling to graphql-js behaviour
144+
- [#5965](https://github.com/ardatan/graphql-tools/pull/5965)
145+
[`3e10da6`](https://github.com/ardatan/graphql-tools/commit/3e10da6b2bf97bdf40317a6d88a0cc6412fd0974)
146+
Thanks [@n1ru4l](https://github.com/n1ru4l)! - revert subscription event source error handling to
147+
graphql-js behaviour
47148

48-
- Updated dependencies [[`baf3c28`](https://github.com/ardatan/graphql-tools/commit/baf3c28f43dcfafffd15386daeb153bc2895c1b3)]:
149+
- Updated dependencies
150+
[[`baf3c28`](https://github.com/ardatan/graphql-tools/commit/baf3c28f43dcfafffd15386daeb153bc2895c1b3)]:
49151
- @graphql-tools/utils@10.1.1
50152

51153
## 1.2.1
52154

53155
### Patch Changes
54156

55-
- [#5913](https://github.com/ardatan/graphql-tools/pull/5913) [`83c0af0`](https://github.com/ardatan/graphql-tools/commit/83c0af0713ff2ce55ccfb97a1810ecfecfeab703) Thanks [@enisdenjo](https://github.com/enisdenjo)! - dependencies updates:
56-
- Updated dependency [`@graphql-tools/utils@^10.0.13` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/10.0.13) (from `^10.0.8`, in `dependencies`)
157+
- [#5913](https://github.com/ardatan/graphql-tools/pull/5913)
158+
[`83c0af0`](https://github.com/ardatan/graphql-tools/commit/83c0af0713ff2ce55ccfb97a1810ecfecfeab703)
159+
Thanks [@enisdenjo](https://github.com/enisdenjo)! - dependencies updates:
160+
- Updated dependency
161+
[`@graphql-tools/utils@^10.0.13` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/10.0.13)
162+
(from `^10.0.8`, in `dependencies`)
57163

58164
## 1.2.0
59165

packages/executor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphql-tools/executor",
3-
"version": "1.2.6",
3+
"version": "1.2.7",
44
"type": "module",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)