1
votes

I have a project build on Rest api, and it uses interfaces. I need to convert it to Graphql classes. Is there a readymade package or tool to help me with this?

1

1 Answers

0
votes

You can use the code-first strategy for GraphQL. You should create a class for each interface and annotate it with ObjectType, InputType and ArgsType, you can check the documentation for ObjectType, for InputType and for ArgsType. If you use polymorphism you should check Unions and Interfaces, both are available at the nestjs documentation