如何列出节点的字段并转储它';谁的数据?GraphQL自省
我可以得到如下的如何列出节点的字段并转储它';谁的数据?GraphQL自省,graphql,introspection,Graphql,Introspection,我可以得到如下的用户名s: query { allUsers { edges { node { username } } } } query { allUsers { edges { node { xxx } } } } 但是,当我对xxx节点尝试相同的方法时,如下所示: query { allUsers { edges { node {
用户名
s:
query {
allUsers {
edges {
node {
username
}
}
}
}
query {
allUsers {
edges {
node {
xxx
}
}
}
}
但是,当我对xxx
节点尝试相同的方法时,如下所示:
query {
allUsers {
edges {
node {
username
}
}
}
}
query {
allUsers {
edges {
node {
xxx
}
}
}
}
它说:
“NoteObjectConnection”类型的字段“xxx”必须有子字段
选择
如何读取
xxx
节点中的数据?在GraphQL中,每个字段必须解析为具体数据(如Int
、Float
、String
等)。错误很简单;您需要在xxx
上选择字段:
query {
allUsers {
edges {
node {
xxx {
other
fields
needed
}
}
}
}
}
xxx
似乎是非标量的,因此需要类似于xxx{…}