提问人:meez 提问时间:11/17/2023 更新时间:11/17/2023 访问量:23
GraphQL Codegen 问题:无法加载与“typescript-common”匹配的模板插件
GraphQL Codegen issue: Unable to load template plugin matching 'typescript-common'
问:
我正在尝试设置 GraphQL 代码生成器。但是我收到这个错误:
gql-gen --config codegen.ts
✔ Parse Configuration
⚠ Generate outputs
❯ Generate to src/graphql/generated/schema.ts
✔ Load GraphQL schemas
✔ Load GraphQL documents
✖
Unable to load template plugin matching 'typescript-common'.
Reason:
Body must be a string. Received: undefined.
ELIFECYCLE Command failed with exit code 1.
我的codegen配置文件:
// codegen.ts
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
schema: [
{
'https://my-endpoint.com': {
headers: {
'Introspection-Key': '8787667676867686678432',
},
},
},
],
documents: ['src/components/**/*.gql'],
generates: {
'src/graphql/generated/schema.ts': {
plugins: [
'typescript-common',
'typescript-client',
'typescript-react-apollo',
],
},
},
};
export default config;
可能是什么问题?
答: 暂无答案
评论