@snapshot-labs/snapshot.js 0.12.4 → 0.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/snapshot.cjs.js +4 -1
- package/dist/snapshot.esm.js +4 -1
- package/dist/snapshot.min.js +1 -1
- package/package.json +1 -1
- package/src/utils.ts +3 -1
package/package.json
CHANGED
package/src/utils.ts
CHANGED
|
@@ -254,6 +254,8 @@ 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: {
|
|
@@ -261,7 +263,7 @@ export async function subgraphRequest(url: string, query, options: any = {}) {
|
|
|
261
263
|
'Content-Type': 'application/json',
|
|
262
264
|
...options?.headers
|
|
263
265
|
},
|
|
264
|
-
body: JSON.stringify(
|
|
266
|
+
body: JSON.stringify(body)
|
|
265
267
|
});
|
|
266
268
|
let responseData: any = await res.text();
|
|
267
269
|
try {
|