Skip to content

Commit

Permalink
fix: Invalid match for masked fragments in #370
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Aug 18, 2024
1 parent 15da5c3 commit 8849b97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ type ObjectLikeType = {
fields: { [key: string]: any };
};

type narrowTypename<T, Typename> = T extends { __typename?: Typename } ? T : never;
type narrowTypename<T, Typename> = '__typename' extends keyof T
? T extends { __typename?: Typename }
? T
: never
: T;

type unwrapTypeRec<
Type,
Expand Down

0 comments on commit 8849b97

Please sign in to comment.