Skip to content

Commit

Permalink
Add specify ID kind in LinkTo
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonF committed Feb 26, 2024
1 parent aaa86ba commit 63a27a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/resources/resource.loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type SomeResourceType = ValueOf<ResourceMap>;
*/
export interface PolymorphicLinkTo<Key extends keyof ResourceMap> {
__typename: Key;
id: ID;
id: ID<Key>;
}

/**
Expand All @@ -30,7 +30,7 @@ export type LinkToUnknown = PolymorphicLinkTo<keyof ResourceMap>;
* A reference to a resource with a static / known type.
*/
export interface LinkTo<Key extends keyof ResourceMap> {
id: ID;
id: ID<Key>;
// Here for DX, and maybe type checking.
// Won't be used at runtime.
__typename?: Key;
Expand Down

0 comments on commit 63a27a2

Please sign in to comment.