babel-plugin-graphql-tag icon indicating copy to clipboard operation
babel-plugin-graphql-tag copied to clipboard

Incompatible with @apollo/client 3.3.19?

Open leethree opened this issue 3 years ago • 3 comments

Apollo client changed the way graphql-tag is exported, it causes runtime error after babel transform:

image

My versions:

    "@apollo/client": "3.3.19",
    "@babel/core": "7.14.3",
    "babel-plugin-graphql-tag": "3.3.0",
    "graphql-tag": "2.12.3",

Babel config:

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
    ['graphql-tag', { importSources: ['graphql-tag'] }],
  ],
};

It works fine when I reverted @apollo/client

leethree avatar May 25 '21 09:05 leethree

try "@apollo/client": "3.3.16"

MikePodgorniy avatar Jun 17 '21 14:06 MikePodgorniy

older version works. but we need to update Apollo version. so this still needs to be fixed.

leethree avatar Jul 22 '21 12:07 leethree

I was able to workaround this on 3.5.x by setting this plugin to only modify imports of @apollo/client

['graphql-tag', { importSources: ['@apollo/client'] }]

awinograd avatar Feb 03 '22 15:02 awinograd