我正在尝试使用 Apollo 查询 GraphQl API。我正在用打字稿在 React 中执行此操作,但我无法让查询组件停止抛出错误。我对整个组合很陌生,所以我可能做了一些明显错误的事情。有任何想法吗?
这是错误:
Type '{ children: (string | (({ loading, error, data }: QueryResult<any, OperationVariables>) => any))[]; query: any; }' is not assignable to type 'Pick<Readonly<QueryProps<any, OperationVariables>> & Readonly<{ children?: ReactNode; }>, "children" | "displayName" | "skip" | "onCompleted" | "onError" | "ssr" | "variables" | ... 6 more ... | "partialRefetch">'.
Types of property 'children' are incompatible.
Type '(string | (({ loading, error, data }: QueryResult<any, OperationVariables>) => any))[]' is not assignable to type …Run Code Online (Sandbox Code Playgroud)