Skip to content

Commit 30981ee

Browse files
authored
Merge branch 'master' into federation-fixes
2 parents bf44cc9 + 391f743 commit 30981ee

File tree

63 files changed

+727
-332
lines changed

Some content is hidden

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

63 files changed

+727
-332
lines changed

.changeset/witty-tables-join.md

-5
This file was deleted.

examples/persisted-documents-string-mode/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"@graphql-typed-document-node/core": "3.2.0",
1111
"jest": "28.1.3",
1212
"babel-jest": "29.7.0",
13-
"@graphql-codegen/cli": "5.0.4",
13+
"@graphql-codegen/cli": "5.0.5",
1414
"@babel/core": "7.25.2",
1515
"@babel/preset-env": "7.25.3",
1616
"@babel/preset-typescript": "7.26.0"

examples/persisted-documents-string-mode/src/gql/graphql.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,13 @@ export class TypedDocumentString<TResult, TVariables>
3939
implements DocumentTypeDecoration<TResult, TVariables>
4040
{
4141
__apiType?: DocumentTypeDecoration<TResult, TVariables>['__apiType'];
42+
private value: string;
43+
public __meta__?: Record<string, any> | undefined;
4244

43-
constructor(private value: string, public __meta__?: Record<string, any> | undefined) {
45+
constructor(value: string, __meta__?: Record<string, any> | undefined) {
4446
super(value);
47+
this.value = value;
48+
this.__meta__ = __meta__;
4549
}
4650

4751
toString(): string & DocumentTypeDecoration<TResult, TVariables> {

examples/persisted-documents/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"@graphql-typed-document-node/core": "3.2.0",
1111
"jest": "28.1.3",
1212
"babel-jest": "29.7.0",
13-
"@graphql-codegen/cli": "5.0.4",
13+
"@graphql-codegen/cli": "5.0.5",
1414
"@babel/core": "7.25.2",
1515
"@babel/preset-env": "7.25.3",
1616
"@babel/preset-typescript": "7.26.0"

examples/programmatic-typescript/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"dependencies": {
1313
"@graphql-codegen/core": "4.0.2",
1414
"@graphql-codegen/plugin-helpers": "5.1.0",
15-
"@graphql-codegen/typed-document-node": "5.0.13",
16-
"@graphql-codegen/typescript": "4.1.3",
17-
"@graphql-codegen/typescript-operations": "4.4.1",
18-
"@graphql-codegen/typescript-resolvers": "4.4.2",
15+
"@graphql-codegen/typed-document-node": "5.1.0",
16+
"@graphql-codegen/typescript": "4.1.5",
17+
"@graphql-codegen/typescript-operations": "4.5.1",
18+
"@graphql-codegen/typescript-resolvers": "4.4.4",
1919
"@graphql-tools/graphql-file-loader": "8.0.1",
2020
"@graphql-tools/load": "8.0.2",
2121
"@graphql-tools/schema": "10.0.6",

examples/react/apollo-client-defer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"graphql-yoga": "5.7.0"
1212
},
1313
"devDependencies": {
14-
"@graphql-codegen/cli": "^5.0.4",
14+
"@graphql-codegen/cli": "^5.0.5",
1515
"@types/jest": "^27.5.2",
1616
"@types/node": "^22.0.0",
1717
"@types/react": "^18.0.15",

examples/react/apollo-client-swc-plugin/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"devDependencies": {
1111
"@graphql-codegen/client-preset-swc-plugin": "0.2.0",
12-
"@graphql-codegen/cli": "^5.0.4",
12+
"@graphql-codegen/cli": "^5.0.5",
1313
"@vitejs/plugin-react-swc": "^3.3.0",
1414
"@types/react": "18.3.3",
1515
"@types/react-dom": "18.3.0",

examples/react/apollo-client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"react-dom": "^18.2.0"
1010
},
1111
"devDependencies": {
12-
"@graphql-codegen/cli": "^5.0.4",
12+
"@graphql-codegen/cli": "^5.0.5",
1313
"@vitejs/plugin-react": "^4.0.0",
1414
"@types/jest": "^27.5.2",
1515
"@types/node": "^22.0.0",

examples/react/http-executor/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"react-dom": "^18.2.0"
99
},
1010
"devDependencies": {
11-
"@graphql-codegen/cli": "^5.0.4",
11+
"@graphql-codegen/cli": "^5.0.5",
1212
"@vitejs/plugin-react": "^4.0.0",
1313
"@types/jest": "^27.5.2",
1414
"@types/node": "^22.0.0",

examples/react/nextjs-swr/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"swr": "^2.0.0"
2020
},
2121
"devDependencies": {
22-
"@graphql-codegen/cli": "^5.0.4",
22+
"@graphql-codegen/cli": "^5.0.5",
2323
"@graphql-codegen/schema-ast": "4.1.0",
2424
"@graphql-codegen/client-preset-swc-plugin": "0.2.0",
2525
"@types/node": "^22.0.0",

examples/react/tanstack-react-query/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"react-dom": "^18.2.0"
99
},
1010
"devDependencies": {
11-
"@graphql-codegen/cli": "^5.0.4",
11+
"@graphql-codegen/cli": "^5.0.5",
1212
"@vitejs/plugin-react": "^4.0.0",
1313
"@types/jest": "^27.5.2",
1414
"@types/node": "^22.0.0",

examples/react/tanstack-react-query/src/gql/graphql.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1303,9 +1303,13 @@ export class TypedDocumentString<TResult, TVariables>
13031303
implements DocumentTypeDecoration<TResult, TVariables>
13041304
{
13051305
__apiType?: DocumentTypeDecoration<TResult, TVariables>['__apiType'];
1306+
private value: string;
1307+
public __meta__?: Record<string, any> | undefined;
13061308

1307-
constructor(private value: string, public __meta__?: Record<string, any> | undefined) {
1309+
constructor(value: string, __meta__?: Record<string, any> | undefined) {
13081310
super(value);
1311+
this.value = value;
1312+
this.__meta__ = __meta__;
13091313
}
13101314

13111315
toString(): string & DocumentTypeDecoration<TResult, TVariables> {

examples/react/urql/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"devDependencies": {
1111
"@types/react": "^18.0.17",
1212
"@types/react-dom": "^18.0.10",
13-
"@graphql-codegen/cli": "^5.0.4",
13+
"@graphql-codegen/cli": "^5.0.5",
1414
"@vitejs/plugin-react": "^4.0.0",
1515
"typescript": "5.5.4",
1616
"serve": "14.2.3",

examples/react/urql/src/gql/graphql.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1303,9 +1303,13 @@ export class TypedDocumentString<TResult, TVariables>
13031303
implements DocumentTypeDecoration<TResult, TVariables>
13041304
{
13051305
__apiType?: DocumentTypeDecoration<TResult, TVariables>['__apiType'];
1306+
private value: string;
1307+
public __meta__?: Record<string, any> | undefined;
13061308

1307-
constructor(private value: string, public __meta__?: Record<string, any> | undefined) {
1309+
constructor(value: string, __meta__?: Record<string, any> | undefined) {
13081310
super(value);
1311+
this.value = value;
1312+
this.__meta__ = __meta__;
13091313
}
13101314

13111315
toString(): string & DocumentTypeDecoration<TResult, TVariables> {

examples/typescript-esm/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"private": true,
55
"devDependencies": {
6-
"@graphql-codegen/cli": "5.0.4"
6+
"@graphql-codegen/cli": "5.0.5"
77
},
88
"dependencies": {
99
"@graphql-typed-document-node/core": "3.2.0",

examples/typescript-graphql-request/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"private": true,
55
"devDependencies": {
6-
"@graphql-codegen/cli": "5.0.4",
6+
"@graphql-codegen/cli": "5.0.5",
77
"babel-jest": "29.7.0",
88
"jest": "28.1.3"
99
},

examples/typescript-graphql-request/src/gql/graphql.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1316,9 +1316,13 @@ export class TypedDocumentString<TResult, TVariables>
13161316
implements DocumentTypeDecoration<TResult, TVariables>
13171317
{
13181318
__apiType?: DocumentTypeDecoration<TResult, TVariables>['__apiType'];
1319+
private value: string;
1320+
public __meta__?: Record<string, any> | undefined;
13191321

1320-
constructor(private value: string, public __meta__?: Record<string, any> | undefined) {
1322+
constructor(value: string, __meta__?: Record<string, any> | undefined) {
13211323
super(value);
1324+
this.value = value;
1325+
this.__meta__ = __meta__;
13221326
}
13231327

13241328
toString(): string & DocumentTypeDecoration<TResult, TVariables> {

examples/typescript-resolvers/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"version": "0.0.0",
44
"private": true,
55
"devDependencies": {
6-
"@graphql-codegen/cli": "5.0.4",
7-
"@graphql-codegen/typescript": "4.1.3",
8-
"@graphql-codegen/typescript-resolvers": "4.4.2"
6+
"@graphql-codegen/cli": "5.0.5",
7+
"@graphql-codegen/typescript": "4.1.5",
8+
"@graphql-codegen/typescript-resolvers": "4.4.4"
99
},
1010
"dependencies": {
1111
"graphql": "16.9.0",

examples/vite/vite-react-cts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"vite": "^6.0.0"
2222
},
2323
"devDependencies": {
24-
"@graphql-codegen/cli": "5.0.4",
24+
"@graphql-codegen/cli": "5.0.5",
2525
"@types/react": "^18.0.27",
2626
"@types/react-dom": "^18.0.10",
2727
"cypress": "14.0.0",

examples/vite/vite-react-mts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"vite": "^6.0.0"
2222
},
2323
"devDependencies": {
24-
"@graphql-codegen/cli": "5.0.4",
24+
"@graphql-codegen/cli": "5.0.5",
2525
"@types/react": "^18.0.27",
2626
"@types/react-dom": "^18.0.10",
2727
"cypress": "14.0.0",

examples/vite/vite-react-ts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"vite": "^6.0.0"
2222
},
2323
"devDependencies": {
24-
"@graphql-codegen/cli": "5.0.4",
24+
"@graphql-codegen/cli": "5.0.5",
2525
"@types/react": "^18.0.27",
2626
"@types/react-dom": "^18.0.10",
2727
"cypress": "14.0.0",

examples/vue/apollo-composable/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"vue": "^3.2.37"
1818
},
1919
"devDependencies": {
20-
"@graphql-codegen/cli": "^5.0.4",
20+
"@graphql-codegen/cli": "^5.0.5",
2121
"@vitejs/plugin-vue": "^5.0.0",
2222
"typescript": "^5.0.0",
2323
"vite": "^6.0.0",

examples/vue/urql/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"vue": "^3.2.45"
1717
},
1818
"devDependencies": {
19-
"@graphql-codegen/cli": "^5.0.4",
19+
"@graphql-codegen/cli": "^5.0.5",
2020
"@vitejs/plugin-vue": "^5.0.0",
2121
"typescript": "^5.0.0",
2222
"vite": "^6.0.0",

examples/vue/villus/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"vue": "^3.2.37"
1717
},
1818
"devDependencies": {
19-
"@graphql-codegen/cli": "^5.0.4",
19+
"@graphql-codegen/cli": "^5.0.5",
2020
"@vitejs/plugin-vue": "^5.0.0",
2121
"typescript": "^5.0.0",
2222
"vite": "^6.0.0",

examples/yoga-tests/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"@graphql-typed-document-node/core": "3.2.0",
1010
"jest": "28.1.3",
1111
"babel-jest": "29.7.0",
12-
"@graphql-codegen/cli": "5.0.4",
12+
"@graphql-codegen/cli": "5.0.5",
1313
"@babel/core": "7.25.2",
1414
"@babel/preset-env": "7.25.3",
1515
"@babel/preset-typescript": "7.26.0"

packages/graphql-codegen-cli/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @graphql-codegen/cli
22

3+
## 5.0.5
4+
5+
### Patch Changes
6+
7+
- [#10282](https://github.com/dotansimha/graphql-code-generator/pull/10282) [`7d7760d`](https://github.com/dotansimha/graphql-code-generator/commit/7d7760d55c21a99417c38ce5e77a6de22b5effcc) Thanks [@oprypkhantc](https://github.com/oprypkhantc)! - Fix watcher watching project root when schema URL is used
8+
39
## 5.0.4
410

511
### Patch Changes

packages/graphql-codegen-cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphql-codegen/cli",
3-
"version": "5.0.4",
3+
"version": "5.0.5",
44
"license": "MIT",
55
"bin": {
66
"gql-gen": "dist/cjs/bin.js",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export function isURL(str: string): boolean {
2+
try {
3+
const url = new URL(str);
4+
return !!url;
5+
} catch {
6+
return false;
7+
}
8+
}

packages/graphql-codegen-cli/src/utils/patterns.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { normalizeInstanceOrArray, Types } from '@graphql-codegen/plugin-helpers
44
import isGlob from 'is-glob';
55
import mm from 'micromatch';
66
import { CodegenContext } from '../config.js';
7+
import { isURL } from './helpers.js';
78

89
type NegatedPattern = `!${string}`;
910

@@ -175,7 +176,7 @@ const makePatternsFromSchemas = (schemas: Types.Schema[]): string[] => {
175176

176177
for (const s of schemas) {
177178
const schema = s as string;
178-
if (isGlob(schema) || isValidPath(schema)) {
179+
if (!isURL(schema) && (isGlob(schema) || isValidPath(schema))) {
179180
patterns.push(schema);
180181
}
181182
}

packages/graphql-codegen-cli/tests/watcher.spec.ts

+17
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ describe('Watch targets', () => {
3434
await stopWatching();
3535
});
3636

37+
test('ignores schema URLs when detecting common prefix directory', async () => {
38+
const { stopWatching, watchDirectory } = await setupMockWatcher({
39+
filepath: './foo/some-config.ts',
40+
config: {
41+
schema: 'http://localhost/graphql',
42+
generates: {
43+
['./foo/some-output.ts']: {
44+
documents: ['./foo/bar/*.graphql'],
45+
},
46+
},
47+
},
48+
});
49+
50+
expect(watchDirectory).toBe(join(process.cwd(), 'foo'));
51+
await stopWatching();
52+
});
53+
3754
test('watches process.cwd() when longest common prefix directory is not accessible', async () => {
3855
setupMockFilesystem({
3956
access: async path => {

packages/plugins/other/fragment-matcher/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @graphql-codegen/fragment-matcher
22

3+
## 5.1.0
4+
5+
### Minor Changes
6+
7+
- [#10214](https://github.com/dotansimha/graphql-code-generator/pull/10214) [`81b20f5`](https://github.com/dotansimha/graphql-code-generator/commit/81b20f5ab35bf73e7797580ba22c910aecdeddbd) Thanks [@tgandrews](https://github.com/tgandrews)! - Add new flag to make the fragment matcher results deterministic
8+
39
## 5.0.2
410

511
### Patch Changes

packages/plugins/other/fragment-matcher/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphql-codegen/fragment-matcher",
3-
"version": "5.0.2",
3+
"version": "5.1.0",
44
"description": "graphql-code-generate plugin for generating fragments matcher introspection file",
55
"repository": {
66
"type": "git",

packages/plugins/other/visitor-plugin-common/CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# @graphql-codegen/visitor-plugin-common
22

3+
## 5.7.1
4+
5+
### Patch Changes
6+
7+
- [#10302](https://github.com/dotansimha/graphql-code-generator/pull/10302) [`d8566c0`](https://github.com/dotansimha/graphql-code-generator/commit/d8566c015943ea4dbcaeaf57d3d8406553ae230a) Thanks [@eddeee888](https://github.com/eddeee888)! - Fix Apollo unmask directive incorrectly generating fragmentRefs
8+
9+
## 5.7.0
10+
11+
### Minor Changes
12+
13+
- [#10270](https://github.com/dotansimha/graphql-code-generator/pull/10270) [`6d7c1d7`](https://github.com/dotansimha/graphql-code-generator/commit/6d7c1d7c0a4662acdc0efafd4234229ad0a8dd3c) Thanks [@adapap](https://github.com/adapap)! - feat: implement `includeExternalFragments: boolean` option
14+
315
## 5.6.1
416

517
### Patch Changes

packages/plugins/other/visitor-plugin-common/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphql-codegen/visitor-plugin-common",
3-
"version": "5.6.1",
3+
"version": "5.7.1",
44
"license": "MIT",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)