我有一个graphql模式
type Post {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
tags:[Tag!]!
}
type Tag {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
name: String!
posts:[Post!]!
}
因此,标签可以应用于许多帖子,而帖子可以具有许多标签。
Prisma生成的代码没有任何问题,但是运行graphql服务器可以提供
Error: Unknown type "TagOrderByInput". Did you mean "PostOrderByInput", "UserOrderByInput", "LikeOrderByInput", "TagWhereInput", or "CommentOrderByInput"?
at assertValidSDL (/home/andriy/app/apollo/prisma/node_modules/graphql/validation/validate.js:89:11)
我将docker与Prisma和Mysql结合使用。有可能有这种关系吗?如果是这样,我在做什么错了?
答案 0 :(得分:0)
解决方案是我已在schema.graphql中导入
public class DatabaseController : Controller
{
private readonly IDatabaseLogic _databaseLogic;
public DatabaseController(IDatabaseLogic databaseLogic)
{
_databaseLogic = databaseLogic;
}
public IActionResult Index(ConnectionInformation connection)
{
var databases = _databaseLogic.GetDatabases(connection);
return View(databases);
}
}
并通过删除Post.PostOrderByInput错误消失了。
# import Post, Query.postsConnection, Post.PostOrderByInput from "./generated-
schema.graphql"