问题描述
当我添加 PaginationAmmountType 来设置每页的最大记录数时,我的所有模型 int 变量都会变成 PaginatioAmount
services.AddGraphQL(SchemaBuilder.New()
.AddType(new PaginationAmountType(100))
.AddQueryType<Query>()
.AddMutationType<Mutation>()
.AddAuthorizeDirectiveType()
);
这是没有 PaginationAmountType 的样子
然后这就是当我添加 PaginationAmountType 时它的变化
我该如何解决这个问题,或者我到底做错了什么,我需要指定每页的最大记录数,但这种方法会弄乱我的模型。
解决方法
我认为问题在于 test_list = [0,1,2,3,4,5,6,7,8,9]
也基于 PaginationAmount
。架构发现 IntType
并将其绑定到 PaginationType
类型
你能试试这个吗:
int
顺便说一句。我们发布了第 11 版。它带来了很多新功能和改进。我们还完全删除了 PaginationAmountType。
查看迁移指南: https://chillicream.com/docs/hotchocolate/api-reference/migrate-from-10-to-11/