You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had originally opted not to support defining interfaces via classes because of the mismatch between TypeScript having single inheritance and GraphQL having multiple inheritance. You can't express:
typeUserimplementsPerson, Node {
# ...
}
using only class inheritance with TypeScript. That said, people do have inheritance setup in their TypeScript code bases which make sense as interfaces as they expose that same code in GraphQL. Following this design principle, we ought to support this for the cases where users have such code.
There will be some challenges:
How do we figure out from TypeScript which classes extend which other classes. Note that we need to include transitive cases. This may impact our incremental compilation strategy.
We need to figure out how overrides work and ensure their ordering is applied correctly. If the concrete class and extended class both implement a field, which one wins? With multiple inheritance this gets tricky.
The text was updated successfully, but these errors were encountered:
I had originally opted not to support defining interfaces via classes because of the mismatch between TypeScript having single inheritance and GraphQL having multiple inheritance. You can't express:
using only class inheritance with TypeScript. That said, people do have inheritance setup in their TypeScript code bases which make sense as interfaces as they expose that same code in GraphQL. Following this design principle, we ought to support this for the cases where users have such code.
There will be some challenges:
The text was updated successfully, but these errors were encountered: