UNPKG

@rep3/rep3-sdk

Version:

`rep3-sdk` is the ts package for projects to integrate rep3-protocol and services in their projects. This documentation will provide various ways and code snippets for the same. To know more about the protocol head over to our [docs](https://docs.rep3.gg/

20 lines (18 loc) 441 B
import { createClient } from 'urql'; export const subgraphGetterFunction = async ( tokensQuery: string, variables: any, url: string ): Promise<any> => { try { const client = createClient({ url, requestPolicy: 'network-only', }); const data = await client.query(tokensQuery, variables).toPromise(); return data; } catch (error) { console.log('Error fetching data: ', error); throw error; } };