How about GraphQL and CommandBus?
elymatos opened this issue · 1 comments
Hi, thanks for the god job!
I'm considering LUCID adoption, but my current app uses GraphQL and CommandBus (via Tacitian). I'm wondering how these pieces come in the LUCID architecture. Any suggestions?
Thanks,
Ely
Hello Ely, and sorry for the late reply.
CommandBus is an extremely similar approach to what LUCID provides, except that the naming conventions of the classes are enough to communicate code structure and the relationship between the different components. Moving from one LUCID project to another will make you feel like home instantly due to the familiarity with naming and code placements.
GraphQL on the other hand, is completely independent from what LUCID is trying to provide. However, you may come up with an abstract and reusable pattern that helps you achieve deep GraphQL integration in your application.
My only experience with GraphQL is with the GitHub API, here's how i structured it:
We have the Queries
folder where we write queries in .graphql
files so that we get the full IDE compatibility such as code completion, syntax check, code lint and most importantly using schema files.
- There's
src/Data/GitHub/Client
Responsible for the communication back and forth with the GitHub API.
Of course, none of these classes should be called directly within a Feature class, but instead to be wrapped by Jobs that return value objects, a.k.a. Entities in our case.
Have you had a similar experience? how did you structure it eventually?