@gqty/solid
Advanced tools
Comparing version 0.1.2-canary-20240712065234.4bfd98429ece5a5aae858c05eb0cbc0d605a7759 to 0.2.0-canary-20240813061601.60d8df9bb8e1c422a589fcf617bc64eda51bd313
@@ -1,4 +0,52 @@ | ||
import { type BaseGeneratedSchema, type Client } from 'gqty'; | ||
import type { SolidClient, SolidClientOptions } from './types'; | ||
import type { BaseGeneratedSchema, Client, RetryOptions } from 'gqty'; | ||
import { type CreateMutation } from './mutation'; | ||
import { type CreateQuery } from './query'; | ||
import { type CreateSubscription } from './subscription'; | ||
export type ArrowFunction = (...args: unknown[]) => unknown; | ||
export type DefaultOptions = { | ||
/** | ||
* Defines how a query should fetch from the cache and network. | ||
* | ||
* - `default`: Serves the cached contents when it is fresh, and if they are | ||
* stale within `staleWhileRevalidate` window, fetches in the background and | ||
* updates the cache. Or simply fetches on stale cache or cache miss. During | ||
* SWR, a successful fetch will not notify cache updates. New contents are | ||
* served on next query. | ||
* - `no-store`: Always fetch and does not update on response. | ||
* GQty creates a temporary cache at query-level which immediately expires. | ||
* - `reload`: Always fetch, updates on response. | ||
* - `no-cache`: Same as `reload`, for GraphQL does not support conditional | ||
* requests. | ||
* - `force-cache`: Serves the cached contents regardless of staleness. It | ||
* fetches on cache miss or a stale cache, updates cache on response. | ||
* - `only-if-cached`: Serves the cached contents regardless of staleness, | ||
* throws a network error on cache miss. | ||
* | ||
* _It takes effort to make sure the above stays true for all supported | ||
* frameworks, please consider sponsoring so we can dedicate even more time on | ||
* this._ | ||
*/ | ||
cachePolicy?: RequestCache; | ||
/** Retry strategy upon fetch failure. */ | ||
retryPolicy?: RetryOptions; | ||
}; | ||
export type CommonOptions = { | ||
/** Custom GraphQL extensions to be exposed to the query fetcher. */ | ||
extensions?: Record<string, unknown>; | ||
/** | ||
* Specify a custom GraphQL operation name in the query. This separates the | ||
* query from the internal query batcher, resulting a standalone fetch for | ||
* easier debugging. | ||
*/ | ||
operationName?: string; | ||
}; | ||
export type SolidClientOptions = { | ||
defaults?: Partial<DefaultOptions>; | ||
}; | ||
export type SolidClient<Schema extends BaseGeneratedSchema> = { | ||
createQuery: CreateQuery<Schema>; | ||
createMutation: CreateMutation<Schema>; | ||
createSubscription: CreateSubscription<Schema>; | ||
}; | ||
export type { BaseGeneratedSchema, Client }; | ||
export declare const createSolidClient: <Schema extends BaseGeneratedSchema>(client: Client<Schema>, options?: SolidClientOptions) => SolidClient<Schema>; |
{ | ||
"name": "@gqty/solid", | ||
"version": "0.1.2-canary-20240712065234.4bfd98429ece5a5aae858c05eb0cbc0d605a7759", | ||
"type": "module", | ||
"version": "0.2.0-canary-20240813061601.60d8df9bb8e1c422a589fcf617bc64eda51bd313", | ||
"private": false, | ||
"sideEffects": false, | ||
"license": "MIT", | ||
"keywords": [ | ||
"cache", | ||
"client", | ||
"gqty", | ||
"graphql", | ||
"reactive", | ||
"solid", | ||
"state" | ||
], | ||
"homepage": "https://gqty.dev", | ||
@@ -13,3 +19,6 @@ "repository": { | ||
}, | ||
"license": "MIT", | ||
"author": "Vicary Archangel <vicary.archangel@member.mensa.org>", | ||
"sideEffects": false, | ||
"type": "module", | ||
"exports": { | ||
@@ -22,30 +31,21 @@ ".": { | ||
}, | ||
"keywords": [ | ||
"cache", | ||
"client", | ||
"gqty", | ||
"graphql", | ||
"reactive", | ||
"solid", | ||
"state" | ||
], | ||
"engines": { | ||
"node": ">=16 <=22" | ||
"dependencies": { | ||
"debounce-microtasks": "^0.1.3", | ||
"p-defer": "^3.0.0" | ||
}, | ||
"publishConfig": { | ||
"directory": "dist" | ||
}, | ||
"devDependencies": { | ||
"@solidjs/testing-library": "^0.8.7", | ||
"@testing-library/jest-dom": "^6.4.5", | ||
"esbuild": "^0.20.2", | ||
"@testing-library/user-event": "^14.5.2", | ||
"@vitest/coverage-v8": "^2.0.5", | ||
"date-fns": "^3.6.0", | ||
"jsdom": "^24.0.0", | ||
"tsx": "^4.9.3", | ||
"typescript": "^5.4.5", | ||
"vitest": "^1.6.0", | ||
"gqty": "^3.1.2-canary-20240712065234.4bfd98429ece5a5aae858c05eb0cbc0d605a7759" | ||
"vite-plugin-solid": "^2.8.2", | ||
"vitest": "^2.0.4", | ||
"test-utils": "^0.2.0" | ||
}, | ||
"peerDependencies": { | ||
"solid-js": "^1.6.0", | ||
"gqty": "^3.1.2-canary-20240712065234.4bfd98429ece5a5aae858c05eb0cbc0d605a7759" | ||
"gqty": "^3.2.1" | ||
}, | ||
@@ -60,9 +60,12 @@ "peerDependenciesMeta": { | ||
}, | ||
"dependencies": { | ||
"debounce-microtasks": "^0.1.3" | ||
"engines": { | ||
"node": ">=16 <=22" | ||
}, | ||
"publishConfig": { | ||
"directory": "dist" | ||
}, | ||
"scripts": { | ||
"build": "tsx build.ts", | ||
"test": "vitest" | ||
"test": "vitest --no-watch" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
18397
12
157
4
10
1
+ Addedp-defer@^3.0.0