File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @snapshot-labs/snapshot.js" ,
3
- "version" : " 0.12.4 " ,
3
+ "version" : " 0.12.5 " ,
4
4
"repository" : " snapshot-labs/snapshot.js" ,
5
5
"license" : " MIT" ,
6
6
"main" : " dist/snapshot.cjs.js" ,
Original file line number Diff line number Diff line change @@ -254,14 +254,16 @@ export async function multicall(
254
254
}
255
255
256
256
export async function subgraphRequest ( url : string , query , options : any = { } ) {
257
+ const body : Record < string , any > = { query : jsonToGraphQLQuery ( { query } ) } ;
258
+ if ( options . variables ) body . variables = options . variables ;
257
259
const res = await fetch ( url , {
258
260
method : 'POST' ,
259
261
headers : {
260
262
Accept : 'application/json' ,
261
263
'Content-Type' : 'application/json' ,
262
264
...options ?. headers
263
265
} ,
264
- body : JSON . stringify ( { query : jsonToGraphQLQuery ( { query } ) } )
266
+ body : JSON . stringify ( body )
265
267
} ) ;
266
268
let responseData : any = await res . text ( ) ;
267
269
try {
You can’t perform that action at this time.
0 commit comments