Skip to content

Commit c5c2c78

Browse files
author
Minh Cung
authored
Merge branch 'master' into patch-1
2 parents 019f74b + 527da03 commit c5c2c78

File tree

260 files changed

+30048
-3794
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+30048
-3794
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/add": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/cli": patch
3+
---
4+
dependencies updates:
5+
- Added dependency [`@graphql-codegen/client-preset@^4.1.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/client-preset/v/4.1.0) (to `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/client-preset": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/core": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/fragment-matcher": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/gql-tag-operations": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/graphql-modules-preset": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/introspection": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/plugin-helpers": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/schema-ast": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/testing": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/testing": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`jest-diff@^23.0.0 || ^24.0.0 || ^25.0.0 || ^26.0.0 || ^27.0.0 || ^28.0.0 || ^29.0.0` ↗︎](https://www.npmjs.com/package/jest-diff/v/23.0.0) (from `^23.0.0 || ^24.0.0 || ^25.0.0 || ^26.0.0 || ^27.0.0 || ^28.0.0`, in `peerDependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/typed-document-node": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/typescript": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/typescript-document-nodes": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/typescript-operations": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/typescript-resolvers": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/visitor-plugin-common": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`tslib@~2.6.0` ↗︎](https://www.npmjs.com/package/tslib/v/2.6.0) (from `~2.5.0`, in `dependencies`)

.changeset/chilled-impalas-prove.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-codegen/client-preset': minor
3+
---
4+
5+
The client preset now allows the use of the `futureProofEnums` config option

.changeset/heavy-jars-notice.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/cli": patch
3+
---
4+
5+
ignore events in `.git` directory

.changeset/hip-garlics-invent.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@graphql-codegen/visitor-plugin-common': minor
3+
'@graphql-codegen/typescript-operations': minor
4+
---
5+
6+
fix: out-of-memory crash (fixes #7720)
7+
perf: implement a caching mechanism that makes sure the type originating at the same location is never generated twice, as long as the combination of selected fields and possible types matches
8+
feat: implement `extractAllFieldsToTypes: boolean`
9+
feat: implement `printFieldsOnNewLines: boolean`

.changeset/perfect-forks-flash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-codegen/visitor-plugin-common': patch
3+
---
4+
5+
Avoid reading from null values when selection sets only contain fragments.

.changeset/plenty-seahorses-laugh.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-codegen/cli': patch
3+
---
4+
5+
Surface error occurring during import of @parcel/watcher

.changeset/quiet-flies-perform.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-codegen/cli': patch
3+
---
4+
5+
Include @graphql-codegen/client-preset in @graphql-codegen/cli by default

.changeset/stupid-onions-tap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-codegen/cli': patch
3+
---
4+
5+
fix watcher unable to find highest common directory on Windows

.github/workflows/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Setup env
3030
uses: the-guild-org/shared-config/setup@main
3131
with:
32-
nodeVersion: 16
32+
nodeVersion: 18
3333
- name: Prettier Check
3434
run: yarn prettier:check
3535
dev-tests-old:
@@ -46,7 +46,7 @@ jobs:
4646
- name: Setup env
4747
uses: the-guild-org/shared-config/setup@main
4848
with:
49-
nodeVersion: 16
49+
nodeVersion: 18
5050
- name: Build
5151
run: yarn build
5252
env:
@@ -64,7 +64,7 @@ jobs:
6464
- name: Setup env
6565
uses: the-guild-org/shared-config/setup@main
6666
with:
67-
nodeVersion: 16
67+
nodeVersion: 18
6868
- uses: actions-rs/toolchain@v1
6969
with:
7070
toolchain: 1.65.0
@@ -97,7 +97,7 @@ jobs:
9797
- name: Setup env
9898
uses: the-guild-org/shared-config/setup@main
9999
with:
100-
nodeVersion: 16
100+
nodeVersion: 18
101101
- name: Build
102102
run: yarn build
103103
env:
@@ -149,7 +149,7 @@ jobs:
149149
name: Build and Unit Test SWC Plugin
150150
runs-on: ubuntu-latest
151151
steps:
152-
- uses: actions/checkout@v2
152+
- uses: actions/checkout@v3
153153
- uses: actions-rs/toolchain@v1
154154
with:
155155
toolchain: 1.65.0

dev-test/codegen.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,17 @@ const config: CodegenConfig = {
221221
preset: 'client',
222222
presetConfig: { fragmentMasking: true },
223223
},
224+
'./dev-test/test-null-value/result.d.ts': {
225+
schema: './dev-test/test-null-value/schema.graphql',
226+
documents: ['./dev-test/test-null-value/query.ts'],
227+
plugins: ['typescript', 'typescript-operations'],
228+
config: {
229+
// The combination of these two flags caused the following issue:
230+
// https://github.com/dotansimha/graphql-code-generator/pull/9709
231+
skipTypename: true,
232+
mergeFragmentTypes: true,
233+
},
234+
},
224235
},
225236
};
226237

dev-test/gatsby/fragments.ts

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
import gql from 'graphql-tag';
2+
3+
export const WPColumns = gql`
4+
fragment WPColumns on WpCoreColumnsBlock {
5+
__typename
6+
attributes {
7+
... on WpCoreColumnsBlockAttributes {
8+
align
9+
verticalAlignment
10+
}
11+
}
12+
innerBlocks {
13+
...WpColumnFields
14+
...WpCoreImageBlockFragment
15+
...WpCoreGalleryBlockFragment
16+
innerBlocks {
17+
__typename
18+
...WpCoreImageBlockForGalleryFragment
19+
...WpCoreGalleryBlockFragment
20+
saveContent
21+
dynamicContent
22+
isDynamic
23+
#
24+
... on WpCoreGalleryBlock {
25+
__typename
26+
...WpCoreGalleryBlockFragment
27+
28+
innerBlocks {
29+
__typename
30+
...WpCoreImageBlockForGalleryFragment
31+
}
32+
}
33+
... on WpCoreColumnsBlock {
34+
innerBlocks {
35+
...WpColumnFields
36+
innerBlocks {
37+
...WpCoreImageBlockFragment
38+
...WpCoreGalleryBlockFragment
39+
... on WpCoreColumnsBlock {
40+
innerBlocks {
41+
...WpColumnFields
42+
innerBlocks {
43+
...WpCoreImageBlockForGalleryFragment
44+
...WpCoreGalleryBlockFragment
45+
}
46+
}
47+
}
48+
}
49+
}
50+
}
51+
}
52+
}
53+
}
54+
`;
55+
56+
export const wpColumnFields = gql`
57+
fragment WpColumnFields on WpCoreColumnBlock {
58+
__typename
59+
saveContent
60+
dynamicContent
61+
isDynamic
62+
attributes {
63+
__typename
64+
}
65+
}
66+
`;
67+
68+
export const WpCoreImageBlockFragment = gql`
69+
fragment WpCoreImageBlockFragment on WpCoreImageBlock {
70+
__typename
71+
saveContent
72+
originalContent
73+
attributes {
74+
__typename
75+
... on WpCoreImageBlockAttributes {
76+
id
77+
alt
78+
caption
79+
width
80+
title
81+
height
82+
linkTarget
83+
url
84+
imageFluid {
85+
childImageSharp {
86+
gatsbyImageData(quality: 100, layout: FULL_WIDTH)
87+
}
88+
}
89+
}
90+
}
91+
}
92+
`;
93+
94+
export const WpCoreImageBlockForGalleryFragment = gql`
95+
fragment WpCoreImageBlockForGalleryFragment on WpCoreImageBlock {
96+
__typename
97+
saveContent
98+
attributes {
99+
__typename
100+
... on WpCoreImageBlockAttributes {
101+
id
102+
alt
103+
caption
104+
width
105+
title
106+
height
107+
linkTarget
108+
url
109+
imageFluid {
110+
childImageSharp {
111+
full: gatsbyImageData(quality: 100, layout: FULL_WIDTH)
112+
thumbnail: gatsbyImageData(layout: CONSTRAINED)
113+
}
114+
}
115+
}
116+
}
117+
}
118+
`;
119+
120+
export const WpCoreParagraphBlockFragment = gql`
121+
fragment WpCoreParagraphBlockFragment on WpCoreParagraphBlock {
122+
__typename
123+
saveContent
124+
isDynamic
125+
dynamicContent
126+
}
127+
`;
128+
129+
export const WpCoreGalleryBlockFragment = gql`
130+
fragment WpCoreGalleryBlockFragment on WpCoreGalleryBlock {
131+
dynamicContent
132+
attributes {
133+
... on WpCoreGalleryBlockAttributes {
134+
align
135+
anchor
136+
ids
137+
caption
138+
images {
139+
id
140+
url
141+
link
142+
alt
143+
caption
144+
}
145+
className
146+
}
147+
}
148+
}
149+
`;

0 commit comments

Comments
 (0)