@apollo/client#ApolloQueryResult TypeScript Examples
The following examples show how to use
@apollo/client#ApolloQueryResult.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: use.imerative.query.ts From ui with GNU Affero General Public License v3.0 | 6 votes |
useImperativeQuery: <TData, TVariables>(
query: DocumentNode
) => (variables: TVariables) => Promise<ApolloQueryResult<TData>> = (query) => {
const { refetch } = useQuery(query, { skip: true })
return useCallback(
(variables) => {
return refetch(variables)
},
[refetch]
)
}
Example #2
Source File: CGraphQLClient.ts From Cromwell with MIT License | 5 votes |
public async query<T = any>(options: QueryOptions): Promise<ApolloQueryResult<T>>;
Example #3
Source File: apollo.interface.ts From svvs with MIT License | 5 votes |
// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-unused-vars
export function extractApolloResponse<T = any>(result: ApolloQueryResult<any>, entitiesKey?: string[]) {
const key = !entitiesKey? Object.keys(entitiesKey) : entitiesKey
return key.length === 1 ? result.data[key[0]] : result.data
}