@ludo.ninja/api-server-assets
Version:
Visit [Pharos Production](https://pharosproduction.com) – the software development company specializing in high-load Web3 and DeFi projects. We deliver projects on time and within budget!
47 lines (46 loc) • 1.89 kB
JavaScript
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {};
export const FetchAssetByBlockchainDocument = gql `
query fetchAssetByBlockchain($blockchain: String!, $address: String, $tokenId: String, $elrondId: String) {
fetchAssetByBlockchain(
blockchain: $blockchain
address: $address
tokenId: $tokenId
elrondId: $elrondId
) {
assetId
}
}
`;
/**
* __useFetchAssetByBlockchainQuery__
*
* To run a query within a React component, call `useFetchAssetByBlockchainQuery` and pass it any options that fit your needs.
* When your component renders, `useFetchAssetByBlockchainQuery` 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 } = useFetchAssetByBlockchainQuery({
* variables: {
* blockchain: // value for 'blockchain'
* address: // value for 'address'
* tokenId: // value for 'tokenId'
* elrondId: // value for 'elrondId'
* },
* });
*/
export function useFetchAssetByBlockchainQuery(baseOptions) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery(FetchAssetByBlockchainDocument, options);
}
export function useFetchAssetByBlockchainLazyQuery(baseOptions) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery(FetchAssetByBlockchainDocument, options);
}
export function useFetchAssetByBlockchainSuspenseQuery(baseOptions) {
const options = baseOptions === Apollo.skipToken ? baseOptions : { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery(FetchAssetByBlockchainDocument, options);
}