小编Bat*_*han的帖子

@Nuxt/Apollo 我如何从 gql 查询中删除“__typeName”

我正在开发 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)

apollo vue.js nuxt.js

3
推荐指数
1
解决办法
1840
查看次数

标签 统计

apollo ×1

nuxt.js ×1

vue.js ×1