Skip to content

Commit

Permalink
Merge pull request #7 from kleros/fix/subgraph-migration
Browse files Browse the repository at this point in the history
fix: migrate endpoints and add headers
  • Loading branch information
salgozino authored Jun 3, 2024
2 parents 2343ced + a0962b5 commit b75a3c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/utils/subgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def __init__(self, network: Literal['mainnet', 'gnosis']) -> None:
self.logger: logging.Logger = logging.getLogger(__name__)
self.network: Literal['mainnet', 'gnosis'] = network
self.index_node = 'https://api.thegraph.com/index-node/graphql'
self.subgraph_node = 'https://api.thegraph.com/subgraphs/name/'
self.subgraph_node = 'https://api.studio.thegraph.com/query/'

def _post_query(self, query):
response: requests.Response = requests.post(self.subgraph_node, json={'query': query})
response: requests.Response = requests.post(self.subgraph_node, json={'query': query}, headers={'Content-Type': 'application/json'})
data = response.json()
try:
data = data['data']
Expand Down Expand Up @@ -89,9 +89,9 @@ def __init__(self, network: Literal['mainnet', 'gnosis']='mainnet') -> None:

# Node definitions
if self.network == 'gnosis':
self.subgraph_name = 'klerosboard/klerosboard-gnosis'
self.subgraph_name = '66145/klerosboard-gnosis/version/latest'
else:
self.subgraph_name = 'klerosboard/klerosboard-mainnet'
self.subgraph_name = '66145/klerosboard-mainnet/version/latest'
self.subgraph_node += self.subgraph_name

@staticmethod
Expand Down

0 comments on commit b75a3c4

Please sign in to comment.