GraphQL queries with tables join using Node.js

后端 未结 2 1841
攒了一身酷
攒了一身酷 2021-02-01 14:52

I am learning GraphQL so I built a little project. Let\'s say I have 2 models, User and Comment.

const Comment = Model.defi         


        
2条回答
  •  迷失自我
    2021-02-01 15:20

    The concept you are refering to is called batching. There are several libraries out there that offer this. For example:

    • Dataloader: generic utility maintained by Facebook that provides "a consistent API over various backends and reduce requests to those backends via batching and caching"

    • join-monster: "A GraphQL-to-SQL query execution layer for batch data fetching."

提交回复
热议问题