For me, this makes more sense (i.e. to derive GraphQL types from the domain) because GraphQL is just an interface to the domain. In other words, I prefer "domain first" design :)
Makes perfectly sense, especially when there are more external interfaces that just GQL that needs to be served by the same domain model.
There might just be the down side that the external representation and the domain model are now identical. You cannot easily have a different internal domain model / storage representation than your external GQL Model. But mostly that’s fine.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks Sven. In my solution the source of truth is the domain model and this is pure TypeScript (no TypeGraph there). For example:
The TypeGraph interfaces are the ones that are derived from the domain modules (note
implements
):For me, this makes more sense (i.e. to derive GraphQL types from the domain) because GraphQL is just an interface to the domain. In other words, I prefer "domain first" design :)
Makes perfectly sense, especially when there are more external interfaces that just GQL that needs to be served by the same domain model.
There might just be the down side that the external representation and the domain model are now identical. You cannot easily have a different internal domain model / storage representation than your external GQL Model. But mostly that’s fine.