apollo-upload-network-interface
apollo-upload-network-interface copied to clipboard
Fix apollo-client import error: 'import' and 'export' may only appear at the top level
When importing from 'apollo-client/transport/networkInterface', the transpiler gives the error:
Error: Parsing file node_modules/apollo-client/transport/networkInterface.js: 'import' and 'export' may only appear at the top level (10:0)
Which is fixed when importing directly from 'apollo-client'. Unfortunately, printRequest isn't exposed that way, so I copied the function from here. Therefore, I had to add graphql-tag as a direct dependency.
With this low risk fix, everything works fine again.