Skip to content

Commit 584dbcc

Browse files
authored
fix(graphql-types-generator): correct typename for nested fragments (#262)
1 parent 186f8cd commit 584dbcc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/graphql-types-generator/src/typescript/codeGeneration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export function interfaceDeclarationForFragment(generator: CodeGenerator, fragme
307307
type: { name: `"${fragment.typeCondition}"` } as GraphQLType,
308308
};
309309
} else {
310-
return field;
310+
return updateTypeNameField(field);
311311
}
312312
});
313313

packages/graphql-types-generator/test/angular/__snapshots__/index.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1938,7 +1938,7 @@ export type humanDetailsFragment = {
19381938
name: string;
19391939
// A list of starships this person has piloted, or an empty list if none
19401940
starships?: Array<{
1941-
__typename: string;
1941+
__typename: \\"Starship\\";
19421942
// The ID of the starship
19431943
id: string;
19441944
// The name of the starship

packages/graphql-types-generator/test/typescript/__snapshots__/codeGeneration.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ export type humanDetailsFragment = {
14671467
name: string,
14681468
// A list of starships this person has piloted, or an empty list if none
14691469
starships?: Array< {
1470-
__typename: string,
1470+
__typename: \\"Starship\\",
14711471
// The ID of the starship
14721472
id: string,
14731473
// The name of the starship

0 commit comments

Comments
 (0)