-
I've just installed and configured /**
* __useGet_Customer_InfoQuery__
*
* To run a query within a React component, call `useGet_Customer_InfoQuery` and pass it any options that fit your needs.
* When your component renders, `useGet_Customer_InfoQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGet_Customer_InfoQuery({
* variables: {
* account_number: // value for 'account_number'
* },
* });
*/
export function useGet_Customer_InfoQuery(
baseOptions: Apollo.QueryHookOptions<
Get_Customer_InfoQuery,
Get_Customer_InfoQueryVariables
>,
) {
return Apollo.useQuery<
Get_Customer_InfoQuery,
Get_Customer_InfoQueryVariables
>(Get_Customer_InfoDocument, baseOptions);
} According to the documentation, the query should support react-hooks options. One of the options listed for react-hooks is "client", which expects an ApolloClient. I've tried a number of permutations, but nothing I've tried has worked. Question |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I figured it out. In case anyone else runs into this, the syntax is actually pretty simple: const customerInfoQuery = useGet_Customer_InfoQuery({
client: your_client_instance_here,
variables: {
account_number: loginState.state.userInfo.accountNumber,
},
}); |
Beta Was this translation helpful? Give feedback.
I figured it out. In case anyone else runs into this, the syntax is actually pretty simple: