Vuejs2 如何在vue apollo apollo查询组件中使用@include或@skip指令?
在模板中,我正在使用组件:Vuejs2 如何在vue apollo apollo查询组件中使用@include或@skip指令?,vuejs2,apollo,apollo-client,vue-apollo,Vuejs2,Apollo,Apollo Client,Vue Apollo,在模板中,我正在使用组件: <ApolloQuery :query="require('../graphql/Albums.gql')" :variables="{ fetchPhotos: true }" ...</ApolloQuery> 当我执行查询时,我得到了所需类型为“Boolean!”的错误“Variable”$fetchPhotos!”!“未提供。” 如何从ApolloQuery组件向查询提供@include布尔值 que
<ApolloQuery
:query="require('../graphql/Albums.gql')"
:variables="{ fetchPhotos: true }"
...</ApolloQuery>
当我执行查询时,我得到了所需类型为“Boolean!”的错误“Variable”$fetchPhotos!”!“未提供。”
如何从ApolloQuery组件向查询提供@include布尔值
query getAllAlbums ($fetchPhotos: Boolean!){
albums{
id
title
tags{
...Tag
weight
}
carouselItems{
id,
mediaUrl
}
photos @include(if: $fetchPhotos){
...Photo
}
}
}