Skip to content

Commit

Permalink
Export request and createGqlOperation utility functions
Browse files Browse the repository at this point in the history
  • Loading branch information
arobsn committed Aug 9, 2024
1 parent a3d2a62 commit 6245bc9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-rice-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fleet-sdk/blockchain-providers": patch
---

Export `request` and `createGqlOperation` utility functions
2 changes: 2 additions & 0 deletions packages/blockchain-providers/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export * from "./ergo-graphql/ergoGraphQLProvider";
export * from "./types/blockchainProvider";
export * from "./utils/networking";
export * from "./utils/graphql";
6 changes: 5 additions & 1 deletion packages/blockchain-providers/src/utils/graphql.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ import { afterEach, describe, expect, expectTypeOf, it, vi } from "vitest";
import { resolveString } from "./_tests";
import {
createGqlOperation,
DEFAULT_HEADERS,
getOpName,
gql,
type GraphQLOperation,
type GraphQLSuccessResponse,
type GraphQLVariables
} from "./graphql";

const DEFAULT_HEADERS = {
"content-type": "application/json; charset=utf-8",
accept: "application/graphql-response+json, application/json"
};

describe("GraphQL query builder", () => {
const parseSpy = vi.spyOn(JSON, "parse");
const stringifySpy = vi.spyOn(JSON, "stringify");
Expand Down
2 changes: 1 addition & 1 deletion packages/blockchain-providers/src/utils/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { FallbackRetryOptions, ParserLike } from "./networking";
import { request } from "./networking";

const OP_NAME_REGEX = /(query|mutation)\s?([\w\-_]+)?/;
export const DEFAULT_HEADERS = {
const DEFAULT_HEADERS = {
"content-type": "application/json; charset=utf-8",
accept: "application/graphql-response+json, application/json"
};
Expand Down
1 change: 0 additions & 1 deletion packages/blockchain-providers/src/utils/networking.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { some } from "@fleet-sdk/common";
import { isEmpty } from "packages/common/src";

export interface ParserLike {
parse<T>(text: string): T;
Expand Down

0 comments on commit 6245bc9

Please sign in to comment.