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

[onlyOperationTypes] missing input types #3957

Merged
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
17 changes: 17 additions & 0 deletions dev-test/star-wars/types.preResolveTypes.onlyOperationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ export enum LengthUnit {
Foot = 'FOOT',
}

/** The input object sent when someone is creating a new review */
export type ReviewInput = {
/** 0-5 stars */
stars: Scalars['Int'];
/** Comment about the movie, optional */
commentary?: Maybe<Scalars['String']>;
/** Favorite color, optional */
favoriteColor?: Maybe<ColorInput>;
};

/** The input object sent when passing a color */
export type ColorInput = {
red: Scalars['Int'];
green: Scalars['Int'];
blue: Scalars['Int'];
};

export type CreateReviewForEpisodeMutationVariables = {
episode: Episode;
review: ReviewInput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export interface RawTypesConfig extends RawConfig {
* ```
*/
wrapFieldDefinitions?: boolean;
/**
/**
* @name onlyOperationTypes
* @type boolean
* @description This will cause the generator to emit types for operations only (basically only enums and scalars)
Expand Down Expand Up @@ -279,7 +279,6 @@ export class BaseTypesVisitor<
}

InputObjectTypeDefinition(node: InputObjectTypeDefinitionNode): string {
if (this.config.onlyOperationTypes) return '';
return this.getInputObjectDeclarationBlock(node).string;
}

Expand Down