发布于 2018-08-14 07:37:48
您提供的查询缺少正在查询的实际变量值。
指向GraphQL端点的HTTP请求的主体应该如下所示:
query:"query myQuery($id: ID!) {
Product(id: $id) {
id
title
}
}"
variables:{id: "ce03707f-971e-4c64-853c-06a8c2e21448"}编辑: Vue特定示例:
// Apollo-specific options
apollo: {
// Query with parameters
ping: {
// gql query
query: gql`query PingMessage($message: String!) {
ping(message: $message)
}`,
// Static parameters
variables: {
message: 'Meow',
},
},
},来自:https://akryum.github.io/vue-apollo/guide/apollo/queries.html#query-with-parameters
https://stackoverflow.com/questions/51823630
复制相似问题