为什么我们在GraphQL中使用现场解析器?

发布于 2025-01-27 10:46:03 字数 217 浏览 2 评论 0原文

因此,我一直在关注Ben Awad的14小时GraphQl和React系列,并且遇到了现场解析器,我对它们的用例感到有些困惑。我知道可以使用现场解析器来修改服务器中的某些数据。在这种特殊情况下,他使用它来切片大量用户帖子的文本,因此在这种情况下,我猜想随着数据的增长,获取大量数据很耗时,因此可以使用现场解析器来修改适当的数据以优化。服务器。我对吗?因为这对我来说很有意义,这就是我的理解方式。他们提供的东西还有更多吗?

So I have been following Ben Awad's 14 hr GraphQL and React series and I came across field resolvers and I have been a little confused about their use-case. I understand that field resolvers can be used to modify a certain data in the server. In this particular case, he uses it to slice the text of huge user posts, so in this context I am guessing that fetching large chunks of data is time consuming as the data grows, so field resolvers can be used to modify appropriate data to optimise the server. Am i right? Because this makes sense to me and this is how i understand it. Is there more to what they offer or is this it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文