Re:CQRS: Command Query Responsibility Segregation (2011)
by superice on Wednesday November 11, 2020 @11:25AM
(#25059662)
REST usually has the same content in your request replacing the entire resource on a PUT, or returning an identical thing on a POST. There is no difference in the schema of the JSON (or XML) you send and receive.
As a sibling comment said: if you implement GraphQL with DTOs that look exactly the same for reading and writing, sure, you won't have CQRS, but it seems like the structure encourages you not to do that since you explicitly CANNOT use the output types as your input types in a GraphQL schema. Besides, real world usages seem to mostly treat it in a CQRS-style way instead of just CRUD operations.
As a sibling comment said: if you implement GraphQL with DTOs that look exactly the same for reading and writing, sure, you won't have CQRS, but it seems like the structure encourages you not to do that since you explicitly CANNOT use the output types as your input types in a GraphQL schema. Besides, real world usages seem to mostly treat it in a CQRS-style way instead of just CRUD operations.