我正在开发 nuxt/apollo 包,但没有有关 addTypeName 属性的信息。这个属性应该在哪里设置呢?注意:所有安装都与@nuxt/apollo 有关。(作为模块等导入)
版本信息 :
"@nuxtjs/apollo": "^4.0.0-rc8",
Run Code Online (Sandbox Code Playgroud)
我在 nuxt.config.js 中的 apollo 配置:
apollo: {
includeNodeModules: false,
authenticationType: 'Basic',
defaultOptions: {
$query: {
loadingKey: 'loading',
fetchPolicy: 'cache-and-network'
}
},
clientConfigs: {
default: {
httpEndpoint: 'DEFAULT_GRAPHQL_ENDPOINT',
tokenName: 'apollo-token' // optional
},
financial: {
httpEndpoint: 'NEWS_GRAPHQL_ENDPOINT',
tokenName: 'apollo-token',
addTypename: false --> **Is not working**
}
}
}
Run Code Online (Sandbox Code Playgroud)
我的 Index.vue 页面是:
apollo: {
data: {
query: gql`
{
newsJson(take: 1) {
key
*GENERATES __typeName when sending request to Graphql*
}
} …Run Code Online (Sandbox Code Playgroud)