问题描述
我有一个.NET Core Web API,并且正在使用浏览器中的GraphiQL来测试我的API。这是我的查询和出现的错误。
我的模式类:
constructor() {
this.state = {
startAt: 0,endAt: 20,};
}
retrieveData(startAt,endAt) {
const ref = firebase.database().ref().child('clubs').startAt(startAt).endAt(endAt);
ref.on('value',gotData,errorData);
function gotData(data) {
// do some stuff with received data
that.setState({
startAt: endAt + 1,endAt: endAt + endAt
});
}
function errorData(error) {
console.log(error);
}
我的突变班:
public class DeveloperSchema : Schema
{
public DeveloperSchema(IDependencyResolver resolver) : base(resolver)
{
Query = resolver.Resolve<DevelopersQuery>();
Mutation = resolver.Resolve<DevelopersMutation>();
}
}
开发人员的InputType:
public class DevelopersMutation : ObjectGraphType
{
public DevelopersMutation(DevelopersContext _developersContext)
{
Field<DeveloperType>(
"CreateDeveloper",arguments: new QueryArguments(
new QueryArgument<NonNullGraphType<DeveloperInputType>> { Name = "developer" }
),resolve: context =>
{
var developer = context.GetArgument<Developer>("developer");
return _developersContext.AddDeveloper(developer);
});
}
}
开发者模型:
public class DeveloperInputType : InputObjectGraphType
{
public DeveloperInputType()
{
Name = "DeveloperInput";
Field<NonNullGraphType<IdGraphType>>("Id");
Field<StringGraphType>("Name");
}
}
我正在使用GraphQL 2.4.0,GraphiQL 3.4.0,.NET Core 3.1
由于查询调用工作正常,因此我没有共享控制器和QueryType结构。我遇到了突变电话问题。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)