houdini-svelte 1.1.3 → 1.2.0-react.1
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/build/plugin-cjs/index.js +261 -225
- package/build/plugin-esm/index.js +261 -225
- package/build/preprocess-cjs/index.js +272 -225
- package/build/preprocess-esm/index.js +272 -225
- package/build/runtime/stores/index.d.ts +1 -1
- package/build/runtime/stores/pagination/fragment.d.ts +4 -7
- package/build/runtime/stores/pagination/query.d.ts +3 -4
- package/build/runtime/stores/query.d.ts +2 -54
- package/build/runtime/types.d.ts +40 -28
- package/build/runtime-cjs/stores/index.d.ts +1 -1
- package/build/runtime-cjs/stores/pagination/fragment.d.ts +4 -7
- package/build/runtime-cjs/stores/pagination/fragment.js +6 -9
- package/build/runtime-cjs/stores/pagination/query.d.ts +3 -4
- package/build/runtime-cjs/stores/pagination/query.js +10 -9
- package/build/runtime-cjs/stores/query.d.ts +2 -54
- package/build/runtime-cjs/types.d.ts +40 -28
- package/build/runtime-esm/stores/index.d.ts +1 -1
- package/build/runtime-esm/stores/pagination/fragment.d.ts +4 -7
- package/build/runtime-esm/stores/pagination/fragment.js +4 -7
- package/build/runtime-esm/stores/pagination/query.d.ts +3 -4
- package/build/runtime-esm/stores/pagination/query.js +5 -4
- package/build/runtime-esm/stores/query.d.ts +2 -54
- package/build/runtime-esm/types.d.ts +40 -28
- package/build/test-cjs/index.js +601 -491
- package/build/test-esm/index.js +601 -491
- package/package.json +2 -2
- package/build/runtime/stores/pagination/cursor.d.ts +0 -13
- package/build/runtime/stores/pagination/fetch.d.ts +0 -3
- package/build/runtime/stores/pagination/offset.d.ts +0 -20
- package/build/runtime/stores/pagination/pageInfo.d.ts +0 -13
- package/build/runtime-cjs/stores/pagination/cursor.d.ts +0 -13
- package/build/runtime-cjs/stores/pagination/cursor.js +0 -191
- package/build/runtime-cjs/stores/pagination/fetch.d.ts +0 -3
- package/build/runtime-cjs/stores/pagination/fetch.js +0 -16
- package/build/runtime-cjs/stores/pagination/offset.d.ts +0 -20
- package/build/runtime-cjs/stores/pagination/offset.js +0 -89
- package/build/runtime-cjs/stores/pagination/pageInfo.d.ts +0 -13
- package/build/runtime-cjs/stores/pagination/pageInfo.js +0 -79
- package/build/runtime-esm/stores/pagination/cursor.d.ts +0 -13
- package/build/runtime-esm/stores/pagination/cursor.js +0 -167
- package/build/runtime-esm/stores/pagination/fetch.d.ts +0 -3
- package/build/runtime-esm/stores/pagination/fetch.js +0 -0
- package/build/runtime-esm/stores/pagination/offset.d.ts +0 -20
- package/build/runtime-esm/stores/pagination/offset.js +0 -65
- package/build/runtime-esm/stores/pagination/pageInfo.d.ts +0 -13
- package/build/runtime-esm/stores/pagination/pageInfo.js +0 -52
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FetchContext } from '$houdini/runtime/client/plugins/fetch';
|
|
2
|
-
import type { GraphQLObject,
|
|
3
|
-
import type { LoadEvent, RequestEvent } from '@sveltejs/kit';
|
|
2
|
+
import type { GraphQLObject, MutationArtifact, QueryArtifact, QueryResult, CachePolicies } from '$houdini/runtime/lib/types';
|
|
4
3
|
import type { PluginArtifactData } from '../../plugin/artifactData';
|
|
4
|
+
import type { ClientFetchParams, LoadEventFetchParams, QueryStoreFetchParams, RequestEventFetchParams } from '../types';
|
|
5
5
|
import { BaseStore } from './base';
|
|
6
6
|
export declare class QueryStore<_Data extends GraphQLObject, _Input extends {}> extends BaseStore<_Data, _Input, QueryArtifact> {
|
|
7
7
|
variables: boolean;
|
|
@@ -31,55 +31,3 @@ export declare function fetchParams<_Data extends GraphQLObject, _Input>(artifac
|
|
|
31
31
|
policy: CachePolicies | undefined;
|
|
32
32
|
params: QueryStoreFetchParams<_Data, _Input>;
|
|
33
33
|
}>;
|
|
34
|
-
type FetchGlobalParams<_Data extends GraphQLObject, _Input> = {
|
|
35
|
-
variables?: _Input;
|
|
36
|
-
/**
|
|
37
|
-
* The policy to use when performing the fetch. If set to CachePolicy.NetworkOnly,
|
|
38
|
-
* a request will always be sent, even if the variables are the same as the last call
|
|
39
|
-
* to fetch.
|
|
40
|
-
*/
|
|
41
|
-
policy?: CachePolicies;
|
|
42
|
-
/**
|
|
43
|
-
* An object that will be passed to the fetch function.
|
|
44
|
-
* You can do what you want with it!
|
|
45
|
-
*/
|
|
46
|
-
metadata?: App.Metadata;
|
|
47
|
-
/**
|
|
48
|
-
* Set to true if you want the promise to pause while it's resolving.
|
|
49
|
-
* Only enable this if you know what you are doing. This will cause route
|
|
50
|
-
* transitions to pause while loading data.
|
|
51
|
-
*/
|
|
52
|
-
blocking?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* A function to call after the fetch happens (whether fake or not)
|
|
55
|
-
*/
|
|
56
|
-
then?: (val: _Data | null) => void | Promise<void>;
|
|
57
|
-
};
|
|
58
|
-
export type LoadEventFetchParams<_Data extends GraphQLObject, _Input> = FetchGlobalParams<_Data, _Input> & {
|
|
59
|
-
/**
|
|
60
|
-
* Directly the `even` param coming from the `load` function
|
|
61
|
-
*/
|
|
62
|
-
event?: LoadEvent;
|
|
63
|
-
};
|
|
64
|
-
export type RequestEventFetchParams<_Data extends GraphQLObject, _Input> = FetchGlobalParams<_Data, _Input> & {
|
|
65
|
-
/**
|
|
66
|
-
* A RequestEvent should be provided when the store is being used in an endpoint.
|
|
67
|
-
* When this happens, fetch also needs to be provided
|
|
68
|
-
*/
|
|
69
|
-
event?: RequestEvent;
|
|
70
|
-
/**
|
|
71
|
-
* The fetch function to use when using this store in an endpoint.
|
|
72
|
-
*/
|
|
73
|
-
fetch?: LoadEvent['fetch'];
|
|
74
|
-
};
|
|
75
|
-
export type ClientFetchParams<_Data extends GraphQLObject, _Input> = FetchGlobalParams<_Data, _Input> & {
|
|
76
|
-
/**
|
|
77
|
-
* An object containing all of the current info necessary for a
|
|
78
|
-
* client-side fetch. Must be called in component initialization with
|
|
79
|
-
* something like this: `const context = getHoudiniFetchContext()`
|
|
80
|
-
*/
|
|
81
|
-
context?: HoudiniFetchContext;
|
|
82
|
-
};
|
|
83
|
-
export type QueryStoreFetchParams<_Data extends GraphQLObject, _Input> = QueryStoreLoadParams<_Data, _Input> | ClientFetchParams<_Data, _Input>;
|
|
84
|
-
export type QueryStoreLoadParams<_Data extends GraphQLObject, _Input> = LoadEventFetchParams<_Data, _Input> | RequestEventFetchParams<_Data, _Input>;
|
|
85
|
-
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { FetchQueryResult, CompiledFragmentKind, QueryResult, GraphQLObject } from '$houdini/runtime/lib/types';
|
|
2
|
-
import type { LoadEvent } from '@sveltejs/kit';
|
|
3
|
-
import type { Readable
|
|
4
|
-
import type { QueryStoreFetchParams } from './stores';
|
|
5
|
-
import type { PageInfo } from './stores/pagination/pageInfo';
|
|
1
|
+
import type { FetchQueryResult, CompiledFragmentKind, QueryResult, GraphQLObject, CursorHandlers, OffsetHandlers, PageInfo, HoudiniFetchContext, FetchParams } from '$houdini/runtime/lib/types';
|
|
2
|
+
import type { LoadEvent, RequestEvent } from '@sveltejs/kit';
|
|
3
|
+
import type { Readable } from 'svelte/store';
|
|
6
4
|
export type QueryInputs<_Data> = FetchQueryResult<_Data> & {
|
|
7
5
|
variables: {
|
|
8
6
|
[key: string]: any;
|
|
@@ -54,29 +52,43 @@ export type OffsetFragmentStoreInstance<_Data extends GraphQLObject, _Input> = {
|
|
|
54
52
|
subscribe: Readable<Reshape<_Data, _Input>>['subscribe'];
|
|
55
53
|
fetching: Readable<boolean>;
|
|
56
54
|
} & OffsetHandlers<_Data, _Input>;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
metadata?: {};
|
|
69
|
-
}) => Promise<void>;
|
|
70
|
-
pageInfo: Writable<PageInfo>;
|
|
71
|
-
fetch(args?: QueryStoreFetchParams<_Data, _Input> | undefined): Promise<QueryResult<_Data, _Input>>;
|
|
55
|
+
type FetchGlobalParams<_Data extends GraphQLObject, _Input> = FetchParams<_Input> & {
|
|
56
|
+
/**
|
|
57
|
+
* Set to true if you want the promise to pause while it's resolving.
|
|
58
|
+
* Only enable this if you know what you are doing. This will cause route
|
|
59
|
+
* transitions to pause while loading data.
|
|
60
|
+
*/
|
|
61
|
+
blocking?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* A function to call after the fetch happens (whether fake or not)
|
|
64
|
+
*/
|
|
65
|
+
then?: (val: _Data | null) => void | Promise<void>;
|
|
72
66
|
};
|
|
73
|
-
export type
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
fetch?: typeof globalThis.fetch;
|
|
79
|
-
}) => Promise<void>;
|
|
80
|
-
fetch(args?: QueryStoreFetchParams<_Data, _Input> | undefined): Promise<QueryResult<_Data, _Input>>;
|
|
67
|
+
export type LoadEventFetchParams<_Data extends GraphQLObject, _Input> = FetchGlobalParams<_Data, _Input> & {
|
|
68
|
+
/**
|
|
69
|
+
* Directly the `even` param coming from the `load` function
|
|
70
|
+
*/
|
|
71
|
+
event?: LoadEvent;
|
|
81
72
|
};
|
|
73
|
+
export type RequestEventFetchParams<_Data extends GraphQLObject, _Input> = FetchGlobalParams<_Data, _Input> & {
|
|
74
|
+
/**
|
|
75
|
+
* A RequestEvent should be provided when the store is being used in an endpoint.
|
|
76
|
+
* When this happens, fetch also needs to be provided
|
|
77
|
+
*/
|
|
78
|
+
event?: RequestEvent;
|
|
79
|
+
/**
|
|
80
|
+
* The fetch function to use when using this store in an endpoint.
|
|
81
|
+
*/
|
|
82
|
+
fetch?: LoadEvent['fetch'];
|
|
83
|
+
};
|
|
84
|
+
export type ClientFetchParams<_Data extends GraphQLObject, _Input> = FetchGlobalParams<_Data, _Input> & {
|
|
85
|
+
/**
|
|
86
|
+
* An object containing all of the current info necessary for a
|
|
87
|
+
* client-side fetch. Must be called in component initialization with
|
|
88
|
+
* something like this: `const context = getHoudiniFetchContext()`
|
|
89
|
+
*/
|
|
90
|
+
context?: HoudiniFetchContext;
|
|
91
|
+
};
|
|
92
|
+
export type QueryStoreFetchParams<_Data extends GraphQLObject, _Input> = QueryStoreLoadParams<_Data, _Input> | ClientFetchParams<_Data, _Input>;
|
|
93
|
+
export type QueryStoreLoadParams<_Data extends GraphQLObject, _Input> = LoadEventFetchParams<_Data, _Input> | RequestEventFetchParams<_Data, _Input>;
|
|
82
94
|
export {};
|