Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TS] Sort global types so order is not determined by order of appearance #535

Merged
merged 1 commit into from
Aug 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1703,15 +1703,6 @@ export enum Episode {
NEWHOPE = \\"NEWHOPE\\",
}

/**
* The input object sent when someone is creating a new review
*/
export interface ReviewInput {
stars: number;
commentary?: string | null;
favorite_color?: ColorInput | null;
}

/**
* The input object sent when passing in a color
*/
Expand All @@ -1721,6 +1712,15 @@ export interface ColorInput {
blue: number;
}

/**
* The input object sent when someone is creating a new review
*/
export interface ReviewInput {
stars: number;
commentary?: string | null;
favorite_color?: ColorInput | null;
}

//==============================================================
// END Enums and Input Objects
//==============================================================
Expand Down Expand Up @@ -1875,15 +1875,6 @@ export enum Episode {
NEWHOPE = \\"NEWHOPE\\",
}

/**
* The input object sent when someone is creating a new review
*/
export interface ReviewInput {
stars: number;
commentary?: string | null;
favorite_color?: ColorInput | null;
}

/**
* The input object sent when passing in a color
*/
Expand All @@ -1893,6 +1884,15 @@ export interface ColorInput {
blue: number;
}

/**
* The input object sent when someone is creating a new review
*/
export interface ReviewInput {
stars: number;
commentary?: string | null;
favorite_color?: ColorInput | null;
}

//==============================================================
// END Enums and Input Objects
//==============================================================
Expand Down Expand Up @@ -2097,15 +2097,6 @@ export enum Episode {
NEWHOPE = \\"NEWHOPE\\",
}

/**
* The input object sent when someone is creating a new review
*/
export interface ReviewInput {
stars: number;
commentary?: string | null;
favorite_color?: ColorInput | null;
}

/**
* The input object sent when passing in a color
*/
Expand All @@ -2115,6 +2106,15 @@ export interface ColorInput {
blue: number;
}

/**
* The input object sent when someone is creating a new review
*/
export interface ReviewInput {
stars: number;
commentary?: string | null;
favorite_color?: ColorInput | null;
}

//==============================================================
// END Enums and Input Objects
//==============================================================
Expand Down
2 changes: 2 additions & 0 deletions packages/apollo-codegen-typescript/src/codeGeneration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ function printEnumsAndInputObjects(generator: TypescriptAPIGenerator, typesUsed:

typesUsed
.filter(type => (type instanceof GraphQLEnumType))
.sort()
.forEach((enumType) => {
generator.typeAliasForEnumType(enumType as GraphQLEnumType);
});

typesUsed
.filter(type => type instanceof GraphQLInputObjectType)
.sort()
.forEach((inputObjectType) => {
generator.typeAliasForInputObjectType(inputObjectType as GraphQLInputObjectType);
});
Expand Down