知识卡片
解析器按责任拆分模块
服务规模扩大后,可将模式加载、根查询解析器、变更解析器、类型字段解析器和数据访问分入不同模块。按职责拆分让契约绑定与业务逻辑更易定位;具体目录命名只是一种实现选择。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Microservice APIs》第 10 章《Building GraphQL APIs with Python》(源文件:_epub-src/OEBPS/Text/10.htm)
- 结论依据:原文把 server、schema、queries、mutations、types、data 分成模块,目的在于降低单文件维护成本。
- 原始内容:To implement a whole API, we need to split our code into different files and add structure to the project; otherwise, the codebase would become difficult to read and to maintain.