Skip to content

Commit

Permalink
chore: generate empty types so v6 js types work (#737)
Browse files Browse the repository at this point in the history
  • Loading branch information
alharris-at authored Oct 7, 2023
1 parent 1847d35 commit f3e0c45
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,6 @@ export function interfaceVariablesDeclarationForOperation(
generator: CodeGenerator,
{ operationName, operationType, variables }: LegacyOperation,
) {
if (!variables || variables.length < 1) {
return;
}
const interfaceName = interfaceVariablesNameFromOperation({operationName, operationType});

interfaceDeclaration(
Expand All @@ -184,7 +181,7 @@ export function interfaceVariablesDeclarationForOperation(
interfaceName,
},
() => {
const properties = propertiesFromFields(generator.context, variables);
const properties = propertiesFromFields(generator.context, variables ?? []);
pickedPropertyDeclarations(generator, properties);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ export type Droid = {
primaryFunction?: string | null,
};
export type HeroAndFriendsNamesQueryVariables = {
};
export type HeroAndFriendsNamesQuery = {
hero: ( {
__typename: \\"Human\\",
Expand Down Expand Up @@ -480,6 +483,9 @@ export type Droid = {
primaryFunction?: string | null,
};
export type HeroAndDetailsQueryVariables = {
};
export type HeroAndDetailsQuery = {
hero: ( {
__typename: \\"Human\\",
Expand Down Expand Up @@ -670,6 +676,9 @@ export type Starship = {
coordinates?: Array< Array< number > > | null,
};
export type StarshipCoordsQueryVariables = {
};
export type StarshipCoordsQuery = {
starship?: {
__typename: \\"Starship\\",
Expand Down Expand Up @@ -782,6 +791,9 @@ export type Droid = {
primaryFunction?: string | null,
};
export type HeroNameQueryVariables = {
};
export type HeroNameQuery = {
hero: ( {
__typename: \\"Human\\",
Expand Down Expand Up @@ -942,6 +954,9 @@ export enum EnumCommentTestCase {
}
export type CustomScalarQueryVariables = {
};
export type CustomScalarQuery = {
commentTest?: {
__typename: \\"CommentTest\\",
Expand Down Expand Up @@ -973,6 +988,9 @@ export type ImplB = {
propB?: number | null,
};
export type CustomScalarQueryVariables = {
};
export type CustomScalarQuery = {
interfaceTest: ( {
__typename: \\"ImplA\\",
Expand Down Expand Up @@ -1011,6 +1029,9 @@ export enum EnumCommentTestCase {
}
export type CustomScalarQueryVariables = {
};
export type CustomScalarQuery = {
commentTest?: {
__typename: \\"CommentTest\\",
Expand Down Expand Up @@ -1045,6 +1066,9 @@ export enum EnumCommentTestCase {
}
export type CustomScalarQueryVariables = {
};
export type CustomScalarQuery = {
commentTest?: {
__typename: \\"CommentTest\\",
Expand Down Expand Up @@ -1073,6 +1097,9 @@ export type PartialB = {
prop: string,
};
export type CustomScalarQueryVariables = {
};
export type CustomScalarQuery = {
unionTest: ( {
__typename: \\"PartialA\\",
Expand Down Expand Up @@ -1189,6 +1216,9 @@ export type Droid = {
primaryFunction?: string | null,
};
export type HeroNameQueryVariables = {
};
export type HeroNameQuery = {
hero: ( {
__typename: \\"Human\\",
Expand Down Expand Up @@ -1318,6 +1348,9 @@ export type Starship = {
coordinates?: Array< Array< number > > | null,
};
export type DroidNameQueryVariables = {
};
export type DroidNameQuery = {
droid?: {
__typename: \\"Droid\\",
Expand Down

0 comments on commit f3e0c45

Please sign in to comment.