hubi
hubi copied to clipboard
Contexts
A hubi context means that tokens and attributes may yield different generated source files.
There are 4 kinds of contextual changes I can think of: add, delete, change and referential.
Example
Givin a token User, I can think in the following contexts, which exist in different repositories of an App
Back-end
- Domain model: Uses Joi Translator to yield user_id, user_name, user_name and user_registred_at attributes
- Sequelize model: Uses Sequelize Translator to generate the same attributes as 1
- GraphQL type: Uses GrapqQL Translator but renames the tokens attributes in order to not expose my internal database schema, by not using "user_" as a prefix and renaming the token to Custumer
Front-end
- Domain model: Uses Joi Translator to yield the same attributes as 3 but also rename the token to Custumer
- React component: Translates exactly as the previous point but using PropTypes Translator
Achievement Service
- Domain model: Uses Joi Translator to yield user_id attribute, as it is all it needs to send achievements
Why this issue is important
At the moment a translator yields exactly what is described by a domain file.