Skip to content

Commit

Permalink
Merge pull request #110 from clober-dex/feat/axios
Browse files Browse the repository at this point in the history
feat: set timeout
  • Loading branch information
graykode authored Sep 27, 2024
2 parents 4e5b534 + 4c190a0 commit 52b5ca9
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/constants/subgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ export class Subgraph {
if (!SUBGRAPH_URL[chainId]) {
throw new Error('Unsupported chain for subgraph')
}
const response = await axios.post(SUBGRAPH_URL[chainId], {
query,
variables,
operationName,
})
const response = await axios.post(
SUBGRAPH_URL[chainId],
{
query,
variables,
operationName,
},
{
timeout: 2000, // TODO: pass with option
},
)

if (response.status === 200) {
return response.data
Expand Down

0 comments on commit 52b5ca9

Please sign in to comment.