So here's the wrapping component where I'm passing in a useQuery hook useOrganizationAutocompleteQuery
generated by graphql-codegen. I'd like to be able to pass in any kind of useQuery hook.
<AutocompleteField
{...props}
getOptionLabel={(option: OrganizationResult) => option.name.value || ''}
queryHook={useOrganizationAutocompleteQuery}
resource="organizations"
/>
How would I type the queryHook
prop to accept any kind of apollo useQuery hook?
queryHook: typeof useOrganizationAutocompleteQuery;
And here's what Apollo has for useQuery
export declare function useQuery<TData = any, TVariables = OperationVariables>(query: DocumentNode, options?: QueryHookOptions<TData, TVariables>): QueryResult<TData, TVariables>;