在 flutter 中使用 hasura,出现以下错误,Graphql 版本 ^3.0.0
Using hasura with flutter , getting the following errors , Graphql version ^3.0.0
在flutter中使用Hasura,出现如下错误,Graphql版本^3.0.0
{
"resource": "/D:/example_hasura1/lib/county.dart",
"owner": "dart",
"code": "argument_type_not_assignable",
"severity": 8,
"message": "The argument type 'Widget Function(QueryResult, {refetch: void Function()})' can't be assigned to the parameter type 'Widget Function(QueryResult, {fetchMore: dynamic Function(FetchMoreOpti[![enter image description here][1]][1]ons), refetch: Future<QueryResult> Function()})'.",
"source": "dart",
"startLineNumber": 24,
"startColumn": 9,
"endLineNumber": 24,
"endColumn": 347,
"tags": []
}
而不是:
建造者:(查询结果结果,{VoidCallback refetch}){
...
}
添加第三个参数,如下所示:
builder: (QueryResult result, {VoidCallback refetch, FetchMore fetchMore}) {
...
}
而且我可以看到您没有检查错误。但是如果你这样做了,那么确保将它从 .error 更改为 .hasException
希望有用
{
"resource": "/D:/example_hasura1/lib/county.dart",
"owner": "dart",
"code": "argument_type_not_assignable",
"severity": 8,
"message": "The argument type 'Widget Function(QueryResult, {refetch: void Function()})' can't be assigned to the parameter type 'Widget Function(QueryResult, {fetchMore: dynamic Function(FetchMoreOpti[![enter image description here][1]][1]ons), refetch: Future<QueryResult> Function()})'.",
"source": "dart",
"startLineNumber": 24,
"startColumn": 9,
"endLineNumber": 24,
"endColumn": 347,
"tags": []
}
而不是: 建造者:(查询结果结果,{VoidCallback refetch}){ ... }
添加第三个参数,如下所示: builder: (QueryResult result, {VoidCallback refetch, FetchMore fetchMore}) { ... }
而且我可以看到您没有检查错误。但是如果你这样做了,那么确保将它从 .error 更改为 .hasException
希望有用