【发布时间】:2019-02-14 03:01:05
【问题描述】:
我不明白为什么控制台会出现这个错误
import gql from 'graphql-tag' // import gql
const getBooksQuery = gql`query // describing query
{
books{
name
id
}
}
`;
export default {
name: "BookList", // template name
apollo: { // apollo instance
query: getBooksQuery // query
}
}
我做错了什么?
【问题讨论】:
-
您能否更具体地说明您遇到的意外错误或输出
-
Missing test attribute on result {books: Array(7), Symbol(id): "ROOT_QUERY"} 这个错误发生在控制台
-
当您将该查询发布到 graphiql 并手动尝试查询时会发生什么?旁注:不需要在 graphql-tag 中指定
query