Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/curly-trees-lead.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/typescript-operations': major
---

BREAKING CHANGE: typescript-operations plugin now generates enum if it is used in operation.
12 changes: 12 additions & 0 deletions dev-test/githunt/typed-document-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,18 @@ export enum VoteType {
Up = 'UP',
}

/** A list of options for the sort order of the feed */
export type FeedType =
/** Sort by a combination of freshness and score, using Reddit's algorithm */
| 'HOT'
/** Newest entries first */
| 'NEW'
/** Highest score entries first */
| 'TOP';

/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

export type OnCommentAddedSubscriptionVariables = Exact<{
repoFullName: string;
}>;
Expand Down
12 changes: 12 additions & 0 deletions dev-test/githunt/types.avoidOptionals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ export enum VoteType {
Up = 'UP',
}

/** A list of options for the sort order of the feed */
export type FeedType =
/** Sort by a combination of freshness and score, using Reddit's algorithm */
| 'HOT'
/** Newest entries first */
| 'NEW'
/** Highest score entries first */
| 'TOP';

/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

export type OnCommentAddedSubscriptionVariables = Exact<{
repoFullName: string;
}>;
Expand Down
12 changes: 12 additions & 0 deletions dev-test/githunt/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ export type Vote = {
/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

/** A list of options for the sort order of the feed */
export type FeedType =
/** Sort by a combination of freshness and score, using Reddit's algorithm */
| 'HOT'
/** Newest entries first */
| 'NEW'
/** Highest score entries first */
| 'TOP';

/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

export type OnCommentAddedSubscriptionVariables = Exact<{
repoFullName: string;
}>;
Expand Down
12 changes: 12 additions & 0 deletions dev-test/githunt/types.enumsAsTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ export type Vote = {
/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

/** A list of options for the sort order of the feed */
export type FeedType =
/** Sort by a combination of freshness and score, using Reddit's algorithm */
| 'HOT'
/** Newest entries first */
| 'NEW'
/** Highest score entries first */
| 'TOP';

/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

export type OnCommentAddedSubscriptionVariables = Exact<{
repoFullName: string;
}>;
Expand Down
12 changes: 12 additions & 0 deletions dev-test/githunt/types.flatten.preResolveTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ export enum VoteType {
Up = 'UP',
}

/** A list of options for the sort order of the feed */
export type FeedType =
/** Sort by a combination of freshness and score, using Reddit's algorithm */
| 'HOT'
/** Newest entries first */
| 'NEW'
/** Highest score entries first */
| 'TOP';

/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

export type OnCommentAddedSubscriptionVariables = Exact<{
repoFullName: string;
}>;
Expand Down
12 changes: 12 additions & 0 deletions dev-test/githunt/types.immutableTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ export enum VoteType {
Up = 'UP',
}

/** A list of options for the sort order of the feed */
export type FeedType =
/** Sort by a combination of freshness and score, using Reddit's algorithm */
| 'HOT'
/** Newest entries first */
| 'NEW'
/** Highest score entries first */
| 'TOP';

/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

export type OnCommentAddedSubscriptionVariables = Exact<{
repoFullName: string;
}>;
Expand Down
12 changes: 12 additions & 0 deletions dev-test/githunt/types.preResolveTypes.onlyOperationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ export enum VoteType {
Up = 'UP',
}

/** A list of options for the sort order of the feed */
export type FeedType =
/** Sort by a combination of freshness and score, using Reddit's algorithm */
| 'HOT'
/** Newest entries first */
| 'NEW'
/** Highest score entries first */
| 'TOP';

/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

export type OnCommentAddedSubscriptionVariables = Exact<{
repoFullName: string;
}>;
Expand Down
12 changes: 12 additions & 0 deletions dev-test/githunt/types.preResolveTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ export enum VoteType {
Up = 'UP',
}

/** A list of options for the sort order of the feed */
export type FeedType =
/** Sort by a combination of freshness and score, using Reddit's algorithm */
| 'HOT'
/** Newest entries first */
| 'NEW'
/** Highest score entries first */
| 'TOP';

/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

export type OnCommentAddedSubscriptionVariables = Exact<{
repoFullName: string;
}>;
Expand Down
12 changes: 12 additions & 0 deletions dev-test/githunt/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ export enum VoteType {
Up = 'UP',
}

/** A list of options for the sort order of the feed */
export type FeedType =
/** Sort by a combination of freshness and score, using Reddit's algorithm */
| 'HOT'
/** Newest entries first */
| 'NEW'
/** Highest score entries first */
| 'TOP';

/** The type of vote to record, when submitting a vote */
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';

export type OnCommentAddedSubscriptionVariables = Exact<{
repoFullName: string;
}>;
Expand Down
9 changes: 9 additions & 0 deletions dev-test/star-wars/types.avoidOptionals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ export type StarshipLengthArgs = {
unit?: InputMaybe<LengthUnit>;
};

/** The episodes in the Star Wars trilogy */
export type Episode =
/** Star Wars Episode V: The Empire Strikes Back, released in 1980. */
| 'EMPIRE'
/** Star Wars Episode VI: Return of the Jedi, released in 1983. */
| 'JEDI'
/** Star Wars Episode IV: A New Hope, released in 1977. */
| 'NEWHOPE';

export type CreateReviewForEpisodeMutationVariables = Exact<{
episode: Episode;
review: ReviewInput;
Expand Down
9 changes: 9 additions & 0 deletions dev-test/star-wars/types.excludeQueryAlpha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ export type StarshipLengthArgs = {
unit?: InputMaybe<LengthUnit>;
};

/** The episodes in the Star Wars trilogy */
export type Episode =
/** Star Wars Episode V: The Empire Strikes Back, released in 1980. */
| 'EMPIRE'
/** Star Wars Episode VI: Return of the Jedi, released in 1983. */
| 'JEDI'
/** Star Wars Episode IV: A New Hope, released in 1977. */
| 'NEWHOPE';

export type CreateReviewForEpisodeMutationVariables = Exact<{
episode: Episode;
review: ReviewInput;
Expand Down
9 changes: 9 additions & 0 deletions dev-test/star-wars/types.excludeQueryBeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ export type StarshipLengthArgs = {
unit?: InputMaybe<LengthUnit>;
};

/** The episodes in the Star Wars trilogy */
export type Episode =
/** Star Wars Episode V: The Empire Strikes Back, released in 1980. */
| 'EMPIRE'
/** Star Wars Episode VI: Return of the Jedi, released in 1983. */
| 'JEDI'
/** Star Wars Episode IV: A New Hope, released in 1977. */
| 'NEWHOPE';

export type CreateReviewForEpisodeMutationVariables = Exact<{
episode: Episode;
review: ReviewInput;
Expand Down
9 changes: 9 additions & 0 deletions dev-test/star-wars/types.globallyAvailable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,15 @@ type StarshipLengthArgs = {
unit?: InputMaybe<LengthUnit>;
};

/** The episodes in the Star Wars trilogy */
type Episode =
/** Star Wars Episode V: The Empire Strikes Back, released in 1980. */
| 'EMPIRE'
/** Star Wars Episode VI: Return of the Jedi, released in 1983. */
| 'JEDI'
/** Star Wars Episode IV: A New Hope, released in 1977. */
| 'NEWHOPE';

type CreateReviewForEpisodeMutationVariables = Exact<{
episode: Episode;
review: ReviewInput;
Expand Down
9 changes: 9 additions & 0 deletions dev-test/star-wars/types.immutableTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ export type StarshipLengthArgs = {
unit?: InputMaybe<LengthUnit>;
};

/** The episodes in the Star Wars trilogy */
export type Episode =
/** Star Wars Episode V: The Empire Strikes Back, released in 1980. */
| 'EMPIRE'
/** Star Wars Episode VI: Return of the Jedi, released in 1983. */
| 'JEDI'
/** Star Wars Episode IV: A New Hope, released in 1977. */
| 'NEWHOPE';

export type CreateReviewForEpisodeMutationVariables = Exact<{
episode: Episode;
review: ReviewInput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ export type ReviewInput = {
stars: Scalars['Int']['input'];
};

/** The episodes in the Star Wars trilogy */
export type Episode =
/** Star Wars Episode V: The Empire Strikes Back, released in 1980. */
| 'EMPIRE'
/** Star Wars Episode VI: Return of the Jedi, released in 1983. */
| 'JEDI'
/** Star Wars Episode IV: A New Hope, released in 1977. */
| 'NEWHOPE';

export type CreateReviewForEpisodeMutationVariables = Exact<{
episode: Episode;
review: ReviewInput;
Expand Down
9 changes: 9 additions & 0 deletions dev-test/star-wars/types.preResolveTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ export type StarshipLengthArgs = {
unit?: InputMaybe<LengthUnit>;
};

/** The episodes in the Star Wars trilogy */
export type Episode =
/** Star Wars Episode V: The Empire Strikes Back, released in 1980. */
| 'EMPIRE'
/** Star Wars Episode VI: Return of the Jedi, released in 1983. */
| 'JEDI'
/** Star Wars Episode IV: A New Hope, released in 1977. */
| 'NEWHOPE';

export type CreateReviewForEpisodeMutationVariables = Exact<{
episode: Episode;
review: ReviewInput;
Expand Down
9 changes: 9 additions & 0 deletions dev-test/star-wars/types.skipSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ export type StarshipLengthArgs = {
unit?: InputMaybe<LengthUnit>;
};

/** The episodes in the Star Wars trilogy */
export type Episode =
/** Star Wars Episode V: The Empire Strikes Back, released in 1980. */
| 'EMPIRE'
/** Star Wars Episode VI: Return of the Jedi, released in 1983. */
| 'JEDI'
/** Star Wars Episode IV: A New Hope, released in 1977. */
| 'NEWHOPE';

export type CreateReviewForEpisodeMutationVariables = Exact<{
episode: Episode;
review: ReviewInput;
Expand Down
9 changes: 9 additions & 0 deletions dev-test/star-wars/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ export type StarshipLengthArgs = {
unit?: InputMaybe<LengthUnit>;
};

/** The episodes in the Star Wars trilogy */
export type Episode =
/** Star Wars Episode V: The Empire Strikes Back, released in 1980. */
| 'EMPIRE'
/** Star Wars Episode VI: Return of the Jedi, released in 1983. */
| 'JEDI'
/** Star Wars Episode IV: A New Hope, released in 1977. */
| 'NEWHOPE';

export type CreateReviewForEpisodeMutationVariables = Exact<{
episode: Episode;
review: ReviewInput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
wrapWithSingleQuotes,
} from './utils.js';

interface ConvertSchemaEnumToDeclarationBlockString {
export interface ConvertSchemaEnumToDeclarationBlockString {
schema: GraphQLSchema;
node: EnumTypeDefinitionNode;
enumName: string;
Expand Down
1 change: 1 addition & 0 deletions packages/plugins/typescript/operations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"dependencies": {
"@graphql-codegen/plugin-helpers": "^6.0.0",
"@graphql-codegen/typescript": "^5.0.4",
"@graphql-codegen/schema-ast": "^5.0.0",
"@graphql-codegen/visitor-plugin-common": "6.1.2",
"auto-bind": "~4.0.0",
"tslib": "~2.6.0"
Expand Down
Loading