dotansimha/graphql-code-generator

Resolve input types with preResolveTypes same as selection sets

Open

#3.958 aberto em 30 de abr. de 2020

Ver no GitHub
 (0 comments) (1 reaction) (0 assignees)TypeScript (1.295 forks)batch import
corehelp wantedkind/enhancementplugins

Métricas do repositório

Stars
 (10.341 stars)
Métricas de merge de PR
 (Mesclagem média 46d 1h) (11 fundiu PRs em 30d)

Description

Option preResolveTypes should work with input types in the same way as with output types

For example (https://github.com/dotansimha/graphql-code-generator/blob/master/dev-test/star-wars/types.preResolveTypes.ts#L237)

export type CreateReviewForEpisodeMutationVariables = {
   /* ... */
  review: ReviewInput;
};

should be

export type CreateReviewForEpisodeMutationVariables = {
  /* ... */
  review: {
    /** 0-5 stars */
    stars: number;
    /** Comment about the movie, optional */
    commentary?: string;
    /** Favorite color, optional */
    favoriteColor?: Maybe<{
      red: number;
      green: number;
      blue: number;
    }>;
  }
};

Guia do colaborador