在react框架使用apollo报错. Unexpected token (150:4)

问题遇到的现象和发生背景

在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.

我的解答思路和尝试过的方法
我想要达到的结果

不报错

文件解析错误,看看是否文件后缀错误,或者少装了什么loader

You may need an appropriate loader to handle this file type.
根据这个 应该是你加了 什么文件 吧 需要特定 loader 解析 。