Closed valiafetisov closed 1 year ago
budget-statement
)ref
)INIT
operation?)budget-statement
) and operations (e.g. INIT
) – basically the same schema returned back, so that frontend/integration can also know what to expect+
Type safe+/-
Extensible
-
Reusable for database
-
Support schema migrations+/-
Type safe
-
Limited support for type safety of the schema itself if declared within typescript
+
Possible to create validators / type guards+
Extensible
-
Reusable for database-
Support schema migrations-
Type safe
@constraint
mentioned below can not be safely validated while editing or at build time)+/-
Extensible
directive
@constraint
directive
modifies GraphQL schema, basic scalars (Int, Float, String) are replaced by custom scalars
+/-
Reusable for database
-
Support schema migrations+/-
Type safe
+
Extensible
+
Reusable for database
+
Support schema migrations
I have a question regarding the set of qualities :
As mentioned in one of the posts you have written in past, when the document schema changes, we would have to also migrate the history of changes (operations) which are stored (i assume) in the database. Was this problem covered by one of the qualities you have listed? If so, it's not really clear how it is handled via one of the listed tools. E.g. if we take typeorm, introduce a document schema migration, how would migration of the (history-)operations be resolved?
we would have to also migrate the history of changes (operations) which are stored (i assume) in the database
No, there is no such requirement, to my knowledge. We would only need to migrate the state, not operations. Each operation will store parameters passed to it as json, unstructured. I general I think it wouldn't make sense to migrate operations, since, for example it's possible that some operation that exist today will not exist in the future – this doesn't mean we need to remove it from the table of executed operations 🙂
Thanks for the investigation - looks like TypeORM is the winner.
The setup would be:
Qs:
Notes:
Document schema was defined in a separate repo packaged via npm as @acaldas/document-model-libs
. This issue is therefore replaced with https://github.com/powerhouse-inc/switchboard-boilerplate/issues/54
Goal
Agree on the document schema definition language
Context
Since our API need to be build on top of the document model structure developed in another repository, we need to agree on what information is enough to be exported from that package in order to make integration smooth and maintainable in the future. For this, I would like to do a small research on what approaches are available, then discuss the outcomes.
Tasks