Engineering Guidelines
Motivation:
Addressing Slow Development Speed and Mitigating Blocking of Parallel Tasks
Â
Rule 1:
Embrace Shadow Testing Always utilize shadow testing during development. After pushing changes to a repository, promptly check the success of the Pipeline in GitLab and verify that nothing is broken. This ensures swift identification and resolution of potential issues. For example, catching a unique mutation name oversight within 10 minutes prevents delays. Understanding the changes from an internal perspective is faster than searching through external commits.
Â
Rule 2:
Prioritize GQL API Considerations When working with the GraphQL API, prioritize unique and descriptive names for Query/Mutation/Subscription. Avoid abbreviations, and remember that GQL differs from REST; keep key entities minimal on the request side, and use resolvers for related entities. For instance, when dealing with favorite currencies, treat it as an array of complete currencies available to the user, enhancing efficiency in rendering.
Â
Rule 3:
Opt for Input Types in GQL Prefer using Input Types in GraphQL over text containing JSON or comma-delimited strings, considering the latter as a last resort. Exceptions exist, such as workflows, but this approach generally enhances code clarity and maintainability.
Â
Rule 4:
Implement Timestamps for Models Ensure that data models with the timestamps: true flag include the createdAt and updatedAt fields during migration. This prevents issues like the one encountered in the Workflows model migration (n 267).
Â
Rule 5:
Employ DB_xxx.list for Pagination Utilize DB_xxx.list for pagination, a specialized request that not only returns data but also includes quantitative parameters like limit (pageSize). This ensures a streamlined approach to handling large datasets and improves the overall efficiency of pagination in the database.
Â