[Vuejs]-Why does apollo muation return "Expecting a parsed GraphQL document" inside vuex?

0👍

By default webpack has no configuration for gql or graphql files. You need to add the configuration explicitly.

install required package.

npm i graphql-tag --save

Then configure webpack.

module: {
  rules: [
    {
      test: /\.(graphql|gql)$/,
      exclude: /node_modules/,
      loader: 'graphql-tag/loader',
    },
  ],
},

Leave a comment