Reusing of types between GraphQL and Rest
Hey,
I'm currently working on some graphql mutations in my backend. The thing is that we support Rest in one side of our backend and graphql in another. We do however have a couple of types that I would like to reuse in both parts. I had a discussion with a teammember, and his opinion is that types should not be mixed, meaning that if I should create "Dto's, models" or however you want to call them both on my graphql side and one on rest. I'm mostly thinking about the convention-based approach of hotchochlate and serilaztion which could be affected by having them mixed.
I'm torn since on the one side, having the types and returns seperate sounds like a good idea, but at the same time having to manage the same types twice and forced to keep a close eye to the namespace could be bothersome.
Any thoughts or experiences?
0 Replies