我使用以下查询并获取值。
const GET_VALUES = gql`
query getValues (
$date_begin: String!
$date_end: String!
) {
production (order_by: {datetime: desc},
where: {value94: {_gt: "0"},
_and: {datetime: {_gt: $date_begin},
_and: {datetime: {_lt: $date_end}}}}
){
datetime
value10
value11
}
}
`;
我可以动态使用“datetime,value10,value11”吗?
const GET_VALUES = gql`
query getValues (
$date_begin: String!
$date_end: String!
$q_values: String!
) {
production (order_by: {datetime: desc},
where: {value94: {_gt: "0"},
_and: {datetime: {_gt: $date_begin},
_and: {datetime: {_lt: $date_end}}}}
){
$q_values
}
}
`;
我有:
错误:[nuxt] 安装应用程序时出错:语法错误:预期名称,找到 $
GraphQL request (13:12)
12:
13: $q_values
^
14: }