dotansimha/graphql-code-generator

Resolve input types with preResolveTypes same as selection sets

Open

#3.958 geöffnet am 30. Apr. 2020

Auf GitHub ansehen
 (0 Kommentare) (1 Reaktion) (0 zugewiesene Personen)TypeScript (1.295 Forks)batch import
corehelp wantedkind/enhancementplugins

Repository-Metriken

Stars
 (10.341 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 46T 1h) (11 gemergte PRs in 30 T)

Beschreibung

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;
    }>;
  }
};

Contributor Guide