grats
grats copied to clipboard
Make classes and interfaces inherit GraphQL fields and interfaces from classes they extend and interfaces they implement
trafficstars
/** @gqlType */
class Parent {
/** @gqlField */
parentField: string;
}
class Intermediate extends Parent {}
/** @gqlType */
export class Child extends Intermediate {
/** @gqlField */
childField: string;
}
Would now extract:
type Child {
childField: String
parentField: String
}
type Parent {
parentField: String
}
This change also allows you to define GraphQL interfaces using TypeScript types.
TODO
- [ ] Documentation
- [x] Integration tests
- [ ] Validate/test method resolution order
- [x] Don't use private methods/properties of the typecontext
- [x] Add caching to avoid duplicate recursion in heritage propagation
- [x] Changelog (this is a breaking change!)