You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript doesn't seem to cope well with there being set fields and extra optional ones in elements. This can be fixed by moving to two fields in elements; atts and optAtts. atts contains the required, default attributes like title, coverImg, and iconImg for pages. optAtts would contain the extra information that gets added dynamically usually by the element being in a database (or survey).
We could also think about storing the atts still as an object, but the optAtts in an array (or could still be in an object). Our databases would then need to show the atts as well as the optAtts.
Access Element and Property types in backend
Currently, I am blind in the backend to types. This is not ideal since a lot of the business logic of actions, adding elements etc. will happen here. I could move to a monorepo... but will do some more research into this. Maybe there is a way to set the type of element data in GraphQL dependent on the variable type.
The text was updated successfully, but these errors were encountered:
There's two main ideas for this improvements
Improve Element types
TypeScript doesn't seem to cope well with there being set fields and extra optional ones in elements. This can be fixed by moving to two fields in elements;
atts
andoptAtts
.atts
contains the required, default attributes liketitle
,coverImg
, andiconImg
forpages
.optAtts
would contain the extra information that gets added dynamically usually by the element being in a database (or survey).We could also think about storing the
atts
still as an object, but theoptAtts
in an array (or could still be in an object). Our databases would then need to show theatts
as well as theoptAtts
.Access Element and Property types in backend
Currently, I am blind in the backend to types. This is not ideal since a lot of the business logic of actions, adding elements etc. will happen here. I could move to a monorepo... but will do some more research into this. Maybe there is a way to set the type of element
data
in GraphQL dependent on the variable type.The text was updated successfully, but these errors were encountered: