Skip to content
Discussion options

You must be logged in to vote

@phryneas would be able to answer better here, but I'm pretty sure this is just an inherent limitation of static typing.

A given API instance can only know about the tags defined within itself. So, if you have baseApi, api1 = baseApi.injectEndpoints(), and api2 = baseApi.injectEndpoints(), api1 knows about the tags from baseApi and itself, but has no way to know tags that are defined in api2. They're entirely separate objects with no type-level relation to each other. Static and dynamic behavior end up at odds with each other.

Given that, the options are really either do some casting here to make TS happy and accept that you're technically bypassing type safety in this small case, or defi…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@joeattardi
Comment options

Answer selected by joeattardi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants