-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename types in src/fragments for consistency
- Loading branch information
Showing
2 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import type { Kind } from '@0no-co/graphql.web'; | ||
|
||
type _FragmentMapContinue<Definitions> = Definitions extends readonly [ | ||
type _getFragmentMapRec<Definitions> = Definitions extends readonly [ | ||
infer Definition, | ||
...infer Rest, | ||
] | ||
? (Definition extends { kind: Kind.FRAGMENT_DEFINITION; name: any } | ||
? { [Name in Definition['name']['value']]: Definition } | ||
: {}) & | ||
_FragmentMapContinue<Rest> | ||
_getFragmentMapRec<Rest> | ||
: {}; | ||
|
||
export type FragmentMap<Document extends { kind: Kind.DOCUMENT; definitions: any[] }> = | ||
_FragmentMapContinue<Document['definitions']>; | ||
export type getFragmentMap<Document extends { kind: Kind.DOCUMENT; definitions: any[] }> = | ||
_getFragmentMapRec<Document['definitions']>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters