简体   繁体   English

如何在 graphql 项目中找到哪个查询或突变花费了多少时间?

[英]how to find which query or mutation is taking how much time in graphql project?

Suppose we have written the graphql query in the following way假设我们按以下方式编写了 graphql 查询

type Query {
    user: User
    book: Book
}

My question is how much time user takes to written user details and how much time book takes to written book details.我的问题是用户花多少时间来写用户详细信息,而花了多少时间来写书的详细信息。

Just want to find time taken by each query to complete.只想找到每个查询完成所花费的时间。

If you are using apollo graphql server then we can just configure tracing and check the time taken by request in graphql playground.如果您使用的是 apollo graphql 服务器,那么我们只需配置跟踪并检查 graphql 游乐场中请求所用的时间。 Just need to updated the config with tracing: true只需要使用 tracing: true 更新配置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM