[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphql #8

Open
luoxue-victor opened this issue Mar 21, 2020 · 2 comments
Open

graphql #8

luoxue-victor opened this issue Mar 21, 2020 · 2 comments
Labels
Projects

Comments

@luoxue-victor
Copy link
Owner

No description provided.

@luoxue-victor luoxue-victor added this to TODO in 后端 Mar 23, 2020
@luoxue-victor
Copy link
Owner Author
luoxue-victor commented Apr 2, 2020

优化 tips

  1. 逐步迁移现有接口
    以下游微服务或数据库为单位进行逐步迁移

  2. 使用新字段或者字段参数来升级接口

  3. 使用DataLoader解决 N+1
    DataLoader 收集单数据请求,交给批处理函数统一处理,减少数据库调用次数

  4. 自动生成 Schema

使用自动生成脚本从数据库/下游服务(主要是rpc)自动生成 Schema

  1. 自定义标量类型

处理非 JSON 类型接口和无法用Query描述的数据结构时,可以自定义标量类型,并实现串花函数。

  1. 不适合使用的一些场景
  • 前端需求简单,接口复用率低
  • 功能迭代不活跃

@luoxue-victor
Copy link
Owner Author

权限管理,graphql 不做任何敏感数据的查询

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

1 participant