# @daohaus/data-fetch-utils
data-fetch-utils provides a subset of utilities primarily utilized within our data libraries. These are key functions required for making API calls to fetch data from a range of sources such as our subgraphs, IPFS, or any other data points we access. This library is not usually used on it's own, but in the context of [@daohaus/moloch-v3-data](https://hackmd.io/@bootleggers/Skfd50_w3/https%3A%2F%2Fhackmd.io%2F%40bootleggers%2FSkOoayYP3) and [@daohaus/profile-data](https://hackmd.io/@bootleggers/Skfd50_w3/https%3A%2F%2Fhackmd.io%2F%40bootleggers%2FBy5EC1tv2).
### [View on Github](https://github.com/HausDAO/monorepo/blob/develop/libs/data-fetch-utils)
- [**Fetch Helpers**](https://github.com/HausDAO/monorepo/blob/develop/libs/data-fetch-utils/src/utils/fetch.ts)
- [**Fetch Errors Formatter**](https://github.com/HausDAO/monorepo/blob/develop/libs/data-fetch-utils/src/utils/fetchErrors.ts)
- [**IPFS Helpers**](https://github.com/HausDAO/monorepo/blob/develop/libs/data-fetch-utils/src/utils/ipfs.ts)
- [**Graphql Fetch Helpers**](https://github.com/HausDAO/monorepo/blob/develop/libs/data-fetch-utils/src/utils/requests.ts)
- [**Types**](https://github.com/HausDAO/monorepo/tree/develop/libs/data-fetch-utils/src/types)
### [Search All Functions](https://hackmd.io/@bootleggers/Skfd50_w3/https%3A%2F%2Fhackmd.io%2Fe_zGq-O5RcOquBiNbuJ4rg)
### [View on NPM](https://www.npmjs.com/package/@daohaus/data-fetch-utils)
## Usage
### Installation
```bash
yarn add @daohaus/data-fetch-utils
```
### Examples
**How to post to IPFS w/ Pinata**
```ts
import { pinataPostJSON } from '@daohaus/keychain-utils';
const res = await pinataPostJSON({
creds: {
pinata_api_key,
pinata_api_secret,
},
jsonString: JSON.stringify({ this: 'is fun' }),
});
```