【发布时间】:2020-08-19 16:53:07
【问题描述】:
我正在尝试设置一个 apollo 项目以了解它的工作原理。
我从node-graphql-server下载了graphQL nodeJS模板
我使用 apollo-angular 设置了一个简单的 angular9 应用程序
我运行服务器,我想在我的 Angular 应用程序中自动生成类型。
我运行了代码命令
apollo codegen:generate --endpoint=http://localhost:500/ --target=typescript --globalTypesFile=./src/app/__generated__/globalTypes.ts
× Generating query files with 'typescript' target
→ No operations or fragments found to generate code for.
Error: No operations or fragments found to generate code for.
at write (C:/Users/feder/AppData/Roaming/npm-cache/_npx/3188/node_modules/apollo/lib/commands/client/codegen.js:72:39)
at Task.task (C:/Users/feder/AppData/Roaming/npm-cache/_npx/3188/node_modules/apollo/lib/commands/client/codegen.js:98:46)
我尝试设置一些
但我不断收到 apollo.config.js
module.exports = {
client: {
includes: [__dirname+'/src/graphql/**'],
service: {
name: "localhost",
url: "https://localhost:500",
}
}
}
并使用该命令进行操作,但我一遍又一遍地收到相同的错误。
如何生成服务器类型?
【问题讨论】:
标签: angular graphql apollo prisma-graphql apollo-angular