Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function useGetMessagesLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) {
return ApolloReactHooks.useLazyQuery(Operations.GetMessages, baseOptions);
}
export type GetMessagesQueryHookResult = ReturnType;
export function useFetchVehicleGraphLocationOnlyObjectsLazyQuery( options?: Omit, 'query'> ) {
const lazyQuery = useLazyQuery(FetchVehicleGraphLocationOnlyDocument, options );
const pickObjects = (query: FetchVehicleGraphLocationOnlyQuery | null | undefined) => { return ( query && query.vehicle ); };
const wrappedLazyQuery = ( options?: QueryLazyOptions ) => {
return lazyQuery[0]();
};
return [wrappedLazyQuery, { ...lazyQuery[1], objects: pickObjects(lazyQuery[1].data) }] as [typeof wrappedLazyQuery, typeof lazyQuery[1] & { objects: ReturnType }];
}
export function useFetchVehicleGraphObjectsLazyQuery( options?: Omit, 'query'> ) {
const lazyQuery = useLazyQuery(FetchVehicleGraphDocument, options );
const pickObjects = (query: FetchVehicleGraphQuery | null | undefined) => { return ( query && query.vehicle ); };
const wrappedLazyQuery = ( options?: QueryLazyOptions ) => {
return lazyQuery[0]();
};
return [wrappedLazyQuery, { ...lazyQuery[1], objects: pickObjects(lazyQuery[1].data) }] as [typeof wrappedLazyQuery, typeof lazyQuery[1] & { objects: ReturnType }];
}
export function useFetchVehicleGraphByIdLazyQuery(options?: Omit, 'query' | 'variables'>) {
const lazyQuery = useLazyQuery(FetchVehicleGraphByIdDocument, options );
const pickVehicleGraph = (query: FetchVehicleGraphByIdQuery | null | undefined) => { return ( query && query.vehicle_by_pk ); };
const wrappedLazyQuery = ({ vehicleId, options }: { vehicleId:string, options?: Omit, 'variables'> }) => {
return lazyQuery[0]({ variables: { vehicleId }, ...options });
};
return [wrappedLazyQuery, { ...lazyQuery[1], vehicleGraph: pickVehicleGraph(lazyQuery[1].data) }] as [typeof wrappedLazyQuery, typeof lazyQuery[1] & { vehicleGraph: ReturnType }];
}
variables: { id: nodeId },
})
const handleGetNetworksQueryData = (data) => {
setNetworks(data.result)
}
const handleGetPeersQueryData = (data) => {
setPeers(data.result)
}
const getNetworksQuery = useQuery(GET_NETWORKS, {
onCompleted: handleGetNetworksQueryData,
})
const [getPeers, getPeersQuery] = useLazyQuery(GET_PEERS, {
onCompleted: handleGetPeersQueryData,
})
useEffect(() => {
window.scrollTo(0, 0)
}, [])
useEffect(() => {
if (isOpen) {
setPeers([])
setNetworks([])
setSelectedPeer(undefined)
setSelectedNetwork(undefined)
if (getPeersQuery.called) {
getNetworksQuery.refetch({}).then((res) => handleGetNetworksQueryData(res.data))
}
export function useSharedBoardLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {
return Apollo.useLazyQuery(SharedBoardDocument, baseOptions);
}
export type SharedBoardQueryHookResult = ReturnType;
export function useFetchVehicleGraphLocationOnlyByIdLazyQuery(options?: Omit, 'query' | 'variables'>) {
const lazyQuery = useLazyQuery(FetchVehicleGraphLocationOnlyByIdDocument, options );
const pickVehicleGraphLocationOnly = (query: FetchVehicleGraphLocationOnlyByIdQuery | null | undefined) => { return ( query && query.vehicle_by_pk ); };
const wrappedLazyQuery = ({ vehicleId, options }: { vehicleId:string, options?: Omit, 'variables'> }) => {
return lazyQuery[0]({ variables: { vehicleId }, ...options });
};
return [wrappedLazyQuery, { ...lazyQuery[1], vehicleGraphLocationOnly: pickVehicleGraphLocationOnly(lazyQuery[1].data) }] as [typeof wrappedLazyQuery, typeof lazyQuery[1] & { vehicleGraphLocationOnly: ReturnType }];
}
export function useFetchDogModelByIdLazyQuery(options?: Omit, 'query' | 'variables'>) {
const lazyQuery = useLazyQuery(FetchDogModelByIdDocument, options );
const pickDogModel = (query: FetchDogModelByIdQuery | null | undefined) => { return ( query && query.dogs_by_pk ); };
const wrappedLazyQuery = ({ dogsId, options }: { dogsId:string, options?: Omit, 'variables'> }) => {
return lazyQuery[0]({ variables: { dogsId }, ...options });
};
return [wrappedLazyQuery, { ...lazyQuery[1], dogModel: pickDogModel(lazyQuery[1].data) }] as [typeof wrappedLazyQuery, typeof lazyQuery[1] & { dogModel: ReturnType }];
}
export function useFetchDogModelObjectsLazyQuery( options?: Omit, 'query'> ) {
const lazyQuery = useLazyQuery(FetchDogModelDocument, options );
const pickObjects = (query: FetchDogModelQuery | null | undefined) => { return ( query && query.dogs ); };
const wrappedLazyQuery = ( options?: QueryLazyOptions ) => {
return lazyQuery[0]();
};
return [wrappedLazyQuery, { ...lazyQuery[1], objects: pickObjects(lazyQuery[1].data) }] as [typeof wrappedLazyQuery, typeof lazyQuery[1] & { objects: ReturnType }];
}