如何在 GraphiQL 中为 GraphQL 查询和变更添加名称?

问题描述

专门从 GraphiQL GUI 命名 GraphQL 查询和更改的语法是什么?

解决方法

要向 graphiql 查询添加名称,只需在根类型后添加您想要的名称,如下所示。然后,您可以选择在单击播放按钮时按名称运行查询。

query query_one {
#some query in here
}
mutation mutation_one {
#some mutation in here
}

enter image description here