Default resolvers = entry point to query (base resolver)
Type
transforms across the layers
At times, even data layer types and server layer types may be different for the same field
uuid
type while server would interpret it just as a string
typeWhen the data is pulled as a response to a request, it first gets pulled from the database
to the repository layer
repository
layer should mirror the DB Schema because we're simply pulling the data-layer into the server layer at this stepRepository layer
method is then called by the service layer
method
Service layer should NOT do everything needed to fulfill the graphql schema expectations
Service
LayerShape the
return shape
in theresolver
, not in other parts of the service layer
When you need to define a graph connection of a field, you must do this in the resolver
layer
server layer
resolver layer
If you don't place the relationships in the resolver layer, you are violating domain boundary and entangling the relationship in domain definition, not based on return
// resolver return shape { primitiveField1: UUID, primitiveField2: number, // return type of service1.getMethod relationshipField1: service1.getMethod(), // return type of service2.getMethod relationshipField2: service2.getMethod() }