问题遇到的现象和发生背景
在react框架使用apollo报错
问题相关代码,请勿粘贴截图
import {
ApolloClient,
InMemoryCache,
ApolloProvider,
useQuery,
gql
} from "@apollo/client";
运行结果及报错内容
./node_modules/graphql/utilities/extendSchema.mjs
Module parse failed: Unexpected token (150:4)
You may need an appropriate loader to handle this file type.
| schemaConfig.subscription && replaceNamedType(schemaConfig.subscription),
| // Then, incorporate schema definition and all schema extensions.
| ...(schemaDef && getOperationTypes([schemaDef])),
| ...getOperationTypes(schemaExtensions),
| }; // Then produce and return a Schema config with these types.
我的解答思路和尝试过的方法
我想要达到的结果
不报错