Skip to content

Commit a4fde8a

Browse files
Fix issues after rebasing (#10563)
* Fix missing dep * chore(dependencies): updated changesets for modified dependencies * Fix dev-tests --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 02af99e commit a4fde8a

4 files changed

Lines changed: 19 additions & 15 deletions

File tree

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+
- Added dependency [`@graphql-codegen/schema-ast@^5.0.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/schema-ast/v/5.0.0) (to `dependencies`)

packages/plugins/typescript/operations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
"dependencies": {
4949
"@graphql-codegen/plugin-helpers": "^6.3.0",
50-
"@graphql-codegen/typescript": "^5.0.10",
50+
"@graphql-codegen/schema-ast": "^5.0.1",
5151
"@graphql-codegen/visitor-plugin-common": "^6.3.0",
5252
"auto-bind": "~4.0.0",
5353
"tslib": "^2.8.0"

packages/plugins/typescript/operations/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export const plugin: PluginFunction<
103103
};
104104
};
105105

106-
export { TypeScriptDocumentsVisitor };
106+
export { TypeScriptDocumentsVisitor, type TypeScriptDocumentsPluginConfig };
107107

108108
const semanticToStrict = async (schema: GraphQLSchema): Promise<GraphQLSchema> => {
109109
try {

packages/plugins/typescript/operations/tests/extract-all-types.spec.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { buildSchema, parse } from 'graphql';
22
import { mergeOutputs, Types } from '@graphql-codegen/plugin-helpers';
33
import { validateTs } from '@graphql-codegen/testing';
4-
import { plugin as tsPlugin } from '../../typescript/src/index.js';
5-
import { plugin, TypeScriptDocumentsPluginConfig } from '../src/index.js';
4+
import { plugin, type TypeScriptDocumentsPluginConfig } from '../src/index.js';
65

76
describe('extractAllFieldsToTypes: true', () => {
8-
const validate = async (content: Types.PluginOutput, config: any = {}, pluginSchema) => {
9-
const m = mergeOutputs([await tsPlugin(pluginSchema, [], config, { outputFile: '' }), content]);
7+
const validate = async (content: Types.PluginOutput) => {
8+
const m = mergeOutputs([content]);
109
validateTs(m, undefined, undefined, undefined, []);
1110

1211
return m;
@@ -197,7 +196,7 @@ describe('extractAllFieldsToTypes: true', () => {
197196
"
198197
`);
199198

200-
await validate(content, config, dummyUserTestSchema);
199+
await validate(content);
201200
});
202201

203202
const complexTestSchemaWithUnionsAndInterfaces = buildSchema(/* GraphQL */ `
@@ -551,7 +550,7 @@ describe('extractAllFieldsToTypes: true', () => {
551550
"
552551
`);
553552

554-
await validate(content, config, complexTestSchemaWithUnionsAndInterfaces);
553+
await validate(content);
555554
});
556555

557556
it('should extract types from multiple fragments (mergeFragmentTypes: true)', async () => {
@@ -725,7 +724,7 @@ describe('extractAllFieldsToTypes: true', () => {
725724
"
726725
`);
727726

728-
await validate(content, config, complexTestSchemaWithUnionsAndInterfaces);
727+
await validate(content);
729728
});
730729

731730
it("should extract types from multiple fragments (inlineFragmentTypes: 'combine')", async () => {
@@ -968,7 +967,7 @@ describe('extractAllFieldsToTypes: true', () => {
968967
"
969968
`);
970969

971-
await validate(content, config, complexTestSchemaWithUnionsAndInterfaces);
970+
await validate(content);
972971
});
973972

974973
it("should extract types from multiple fragments (inlineFragmentTypes: 'mask')", async () => {
@@ -1209,7 +1208,7 @@ describe('extractAllFieldsToTypes: true', () => {
12091208
"
12101209
`);
12111210

1212-
await validate(content, config, complexTestSchemaWithUnionsAndInterfaces);
1211+
await validate(content);
12131212
});
12141213

12151214
it('fields with shared types and no fragments should use the shared type interface name', async () => {
@@ -1302,7 +1301,7 @@ describe('extractAllFieldsToTypes: true', () => {
13021301
"
13031302
`);
13041303

1305-
await validate(content, config, nestedInterfacesSchema);
1304+
await validate(content);
13061305
});
13071306

13081307
it('fragment spreads on the same interface should not force concrete parent type names (regression #10502)', async () => {
@@ -1408,7 +1407,7 @@ describe('extractAllFieldsToTypes: true', () => {
14081407
"
14091408
`);
14101409

1411-
await validate(content, config, interfaceFragmentSchema);
1410+
await validate(content);
14121411
});
14131412

14141413
// Exception case for Issue #10502 - shared schema for fragment tests
@@ -1517,7 +1516,7 @@ describe('extractAllFieldsToTypes: true', () => {
15171516
export type GetNotificationsQuery = GetNotificationsQuery_Query;
15181517
"
15191518
`);
1520-
await validate(content, config, notificationSchema);
1519+
await validate(content);
15211520
});
15221521

15231522
it('named fragments should use their name and not parent type name', async () => {
@@ -1598,6 +1597,6 @@ describe('extractAllFieldsToTypes: true', () => {
15981597
export type GetNotificationsQuery = GetNotificationsQuery_Query;
15991598
"
16001599
`);
1601-
await validate(content, config, notificationSchema);
1600+
await validate(content);
16021601
});
16031602
});

0 commit comments

Comments
 (0)