@settlemint/sdk-thegraph
Advanced tools
Comparing version
@@ -18,3 +18,3 @@ import { AbstractSetupSchema, FragmentOf, ResultOf, VariablesOf, initGraphQLTada, readFragment } from "gql.tada"; | ||
instances: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>; | ||
accessToken: z.ZodString; | ||
accessToken: z.ZodOptional<z.ZodString>; | ||
subgraphName: z.ZodString; | ||
@@ -21,0 +21,0 @@ cache: z.ZodOptional<z.ZodEnum<{ |
@@ -0,1 +1,2 @@ | ||
import { appendHeaders } from "@settlemint/sdk-utils/http"; | ||
import { ensureServer } from "@settlemint/sdk-utils/runtime"; | ||
@@ -13,3 +14,3 @@ import { ApplicationAccessTokenSchema, UrlOrPathSchema, validate } from "@settlemint/sdk-utils/validation"; | ||
instances: z.array(UrlOrPathSchema), | ||
accessToken: ApplicationAccessTokenSchema, | ||
accessToken: ApplicationAccessTokenSchema.optional(), | ||
subgraphName: z.string(), | ||
@@ -95,6 +96,3 @@ cache: z.enum([ | ||
...clientOptions, | ||
headers: { | ||
...clientOptions?.headers ?? {}, | ||
"x-auth-token": validatedOptions.accessToken | ||
} | ||
headers: appendHeaders(clientOptions?.headers, { "x-auth-token": validatedOptions.accessToken }) | ||
}), | ||
@@ -101,0 +99,0 @@ graphql |
@@ -18,3 +18,3 @@ import { AbstractSetupSchema, FragmentOf, ResultOf, VariablesOf, initGraphQLTada, readFragment } from "gql.tada"; | ||
instances: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>; | ||
accessToken: z.ZodString; | ||
accessToken: z.ZodOptional<z.ZodString>; | ||
subgraphName: z.ZodString; | ||
@@ -21,0 +21,0 @@ cache: z.ZodOptional<z.ZodEnum<{ |
@@ -0,1 +1,2 @@ | ||
import { appendHeaders } from "@settlemint/sdk-utils/http"; | ||
import { ensureServer } from "@settlemint/sdk-utils/runtime"; | ||
@@ -13,3 +14,3 @@ import { ApplicationAccessTokenSchema, UrlOrPathSchema, validate } from "@settlemint/sdk-utils/validation"; | ||
instances: z.array(UrlOrPathSchema), | ||
accessToken: ApplicationAccessTokenSchema, | ||
accessToken: ApplicationAccessTokenSchema.optional(), | ||
subgraphName: z.string(), | ||
@@ -95,6 +96,3 @@ cache: z.enum([ | ||
...clientOptions, | ||
headers: { | ||
...clientOptions?.headers ?? {}, | ||
"x-auth-token": validatedOptions.accessToken | ||
} | ||
headers: appendHeaders(clientOptions?.headers, { "x-auth-token": validatedOptions.accessToken }) | ||
}), | ||
@@ -101,0 +99,0 @@ graphql |
{ | ||
"name": "@settlemint/sdk-thegraph", | ||
"description": "TheGraph integration module for SettleMint SDK, enabling querying and indexing of blockchain data through subgraphs", | ||
"version": "2.3.4", | ||
"version": "2.3.5-main551b6bba", | ||
"type": "module", | ||
@@ -55,3 +55,3 @@ "private": false, | ||
"gql.tada": "^1", | ||
"@settlemint/sdk-utils": "2.3.4", | ||
"@settlemint/sdk-utils": "2.3.5-main551b6bba", | ||
"graphql-request": "^7", | ||
@@ -58,0 +58,0 @@ "zod": "^3.25.0" |
@@ -55,3 +55,3 @@ <p align="center"> | ||
Defined in: [sdk/thegraph/src/thegraph.ts:90](https://github.com/settlemint/sdk/blob/v2.3.4/sdk/thegraph/src/thegraph.ts#L90) | ||
Defined in: [sdk/thegraph/src/thegraph.ts:91](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/thegraph/src/thegraph.ts#L91) | ||
@@ -70,4 +70,4 @@ Creates a TheGraph GraphQL client with proper type safety using gql.tada | ||
| ------ | ------ | ------ | | ||
| `options` | \{ `accessToken`: `string`; `cache?`: `"default"` \| `"force-cache"` \| `"no-cache"` \| `"no-store"` \| `"only-if-cached"` \| `"reload"`; `instances`: `string`[]; `subgraphName`: `string`; \} | Configuration options for the client including instance URLs, access token and subgraph name | | ||
| `options.accessToken` | `string` | - | | ||
| `options` | \{ `accessToken?`: `string`; `cache?`: `"default"` \| `"force-cache"` \| `"no-cache"` \| `"no-store"` \| `"only-if-cached"` \| `"reload"`; `instances`: `string`[]; `subgraphName`: `string`; \} | Configuration options for the client including instance URLs, access token and subgraph name | | ||
| `options.accessToken?` | `string` | - | | ||
| `options.cache?` | `"default"` \| `"force-cache"` \| `"no-cache"` \| `"no-store"` \| `"only-if-cached"` \| `"reload"` | - | | ||
@@ -88,4 +88,4 @@ | `options.instances?` | `string`[] | - | | ||
| ------ | ------ | ------ | | ||
| `client` | `GraphQLClient` | [sdk/thegraph/src/thegraph.ts:94](https://github.com/settlemint/sdk/blob/v2.3.4/sdk/thegraph/src/thegraph.ts#L94) | | ||
| `graphql` | `initGraphQLTada`\<`Setup`\> | [sdk/thegraph/src/thegraph.ts:95](https://github.com/settlemint/sdk/blob/v2.3.4/sdk/thegraph/src/thegraph.ts#L95) | | ||
| `client` | `GraphQLClient` | [sdk/thegraph/src/thegraph.ts:95](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/thegraph/src/thegraph.ts#L95) | | ||
| `graphql` | `initGraphQLTada`\<`Setup`\> | [sdk/thegraph/src/thegraph.ts:96](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/thegraph/src/thegraph.ts#L96) | | ||
@@ -143,3 +143,3 @@ ##### Throws | ||
Defined in: [sdk/thegraph/src/thegraph.ts:25](https://github.com/settlemint/sdk/blob/v2.3.4/sdk/thegraph/src/thegraph.ts#L25) | ||
Defined in: [sdk/thegraph/src/thegraph.ts:26](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/thegraph/src/thegraph.ts#L26) | ||
@@ -154,3 +154,3 @@ Type definition for client options derived from the ClientOptionsSchema | ||
Defined in: [sdk/thegraph/src/thegraph.ts:10](https://github.com/settlemint/sdk/blob/v2.3.4/sdk/thegraph/src/thegraph.ts#L10) | ||
Defined in: [sdk/thegraph/src/thegraph.ts:11](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/thegraph/src/thegraph.ts#L11) | ||
@@ -163,5 +163,5 @@ Type definition for GraphQL client configuration options | ||
> `const` **ClientOptionsSchema**: `ZodObject`\<\{ `accessToken`: `ZodString`; `cache`: `ZodOptional`\<`ZodEnum`\<\{ `default`: `"default"`; `force-cache`: `"force-cache"`; `no-cache`: `"no-cache"`; `no-store`: `"no-store"`; `only-if-cached`: `"only-if-cached"`; `reload`: `"reload"`; \}\>\>; `instances`: `ZodArray`\<`ZodUnion`\<readonly \[`ZodString`, `ZodString`\]\>\>; `subgraphName`: `ZodString`; \}, `$strip`\> | ||
> `const` **ClientOptionsSchema**: `ZodObject`\<\{ `accessToken`: `ZodOptional`\<`ZodString`\>; `cache`: `ZodOptional`\<`ZodEnum`\<\{ `default`: `"default"`; `force-cache`: `"force-cache"`; `no-cache`: `"no-cache"`; `no-store`: `"no-store"`; `only-if-cached`: `"only-if-cached"`; `reload`: `"reload"`; \}\>\>; `instances`: `ZodArray`\<`ZodUnion`\<readonly \[`ZodString`, `ZodString`\]\>\>; `subgraphName`: `ZodString`; \}, `$strip`\> | ||
Defined in: [sdk/thegraph/src/thegraph.ts:15](https://github.com/settlemint/sdk/blob/v2.3.4/sdk/thegraph/src/thegraph.ts#L15) | ||
Defined in: [sdk/thegraph/src/thegraph.ts:16](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/thegraph/src/thegraph.ts#L16) | ||
@@ -168,0 +168,0 @@ Schema for validating client options for the TheGraph client. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
48625
1.03%499
-1.19%1
Infinity%+ Added
- Removed