Skip to content

Commit

Permalink
Merge branch 'wsdt/graph-outsource' into support-fdg
Browse files Browse the repository at this point in the history
  • Loading branch information
boyuan-chen committed Aug 8, 2024
2 parents 0f429a8 + a651440 commit fe36dbf
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
- run: npm i
- run: npm test
env:
THE_GRAPH_API_KEY: ${{ secrets.THE_GRAPH_API_KEY }}
REACT_APP_THE_GRAPH_API_KEY: ${{ secrets.THE_GRAPH_API_KEY }}
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,24 @@ GraphQL Services

## Release
1. Run `npm run build`
2. Then `npm publish --access public --otp xxxxxx`
2. Then `npm publish --access public --otp xxxxxx`

## Installation..

```ssh
yarn add @bobanetwork/graphql-utils
```

or

```ssh
npm install @bobanetwork/graphq-utils.
```

## For smooth functioning of package need expose env var below via process.

`REACT_APP_THE_GRAPH_API_KEY` - The graph api key which helpfuls to fetch the graph data.
6 changes: 3 additions & 3 deletions src/graphql.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import {
} from '@apollo/client/core'
import {BigNumberish} from 'ethers'
import {EGraphQLService} from "./types";
import { config } from 'dotenv';
// import { config } from 'dotenv';

config();
// config();

let fetchLib = fetch
if (!fetchLib) {
fetchLib = require('node-fetch');
}

export class GraphQLService {
private readonly apikey = process.env.THE_GRAPH_API_KEY
private readonly apikey = process.env.REACT_APP_THE_GRAPH_API_KEY

private readonly uri = `https://gateway-arbitrum.network.thegraph.com/api/${this.apikey}/subgraphs/id`

Expand Down
1 change: 1 addition & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export default defineConfig({
splitting: false,
sourcemap: true,
clean: true,
noExternal: ["@ethersproject/providers", "@apollo/client", "ethers"]
});

0 comments on commit fe36dbf

Please sign in to comment.