@nkzw/fate 1.0.3 → 1.1.0
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/README.md +354 -2
- package/docs/api/classes/FateClient.md +110 -40
- package/docs/api/functions/clientRoot.md +1 -1
- package/docs/api/functions/createClient.md +8 -4
- package/docs/api/functions/createGraphQLTransport.md +21 -0
- package/docs/api/functions/createHTTPTransport.md +1 -1
- package/docs/api/functions/createTRPCTransport.md +1 -1
- package/docs/api/functions/getListEntries.md +1 -1
- package/docs/api/functions/getSelectionPlan.md +1 -1
- package/docs/api/functions/graphqlMutation.md +39 -0
- package/docs/api/functions/isRecord.md +1 -1
- package/docs/api/functions/isViewTag.md +1 -1
- package/docs/api/functions/liveConnectionTopic.md +1 -1
- package/docs/api/functions/liveEntityTopic.md +1 -1
- package/docs/api/functions/liveGlobalConnectionTopic.md +1 -1
- package/docs/api/functions/mutation.md +1 -1
- package/docs/api/functions/toEntityId.md +1 -1
- package/docs/api/functions/view.md +1 -1
- package/docs/api/index.md +10 -0
- package/docs/api/interfaces/FateThenable.md +3 -3
- package/docs/api/interfaces/Transport.md +7 -7
- package/docs/api/server/classes/FateRequestError.md +5 -5
- package/docs/api/server/drizzle/functions/createDrizzleFate.md +1 -1
- package/docs/api/server/drizzle/functions/createDrizzleSourceAdapter.md +1 -1
- package/docs/api/server/drizzle/functions/createDrizzleSourceRegistry.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyConfig.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyInput.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleQueryExtra.md +3 -3
- package/docs/api/server/drizzle/type-aliases/DrizzleSourceAdapter.md +9 -9
- package/docs/api/server/drizzle/type-aliases/DrizzleViewConfig.md +1 -1
- package/docs/api/server/functions/bindSourceProcedures.md +1 -1
- package/docs/api/server/functions/computed.md +1 -1
- package/docs/api/server/functions/count.md +1 -1
- package/docs/api/server/functions/createFateFetchHandler.md +1 -1
- package/docs/api/server/functions/createFateServer.md +1 -1
- package/docs/api/server/functions/createHonoFateHandler.md +1 -1
- package/docs/api/server/functions/createLiveEventBus.md +1 -1
- package/docs/api/server/functions/createNestedSourcePlan.md +1 -1
- package/docs/api/server/functions/createResolver.md +1 -1
- package/docs/api/server/functions/createSourcePlan.md +1 -1
- package/docs/api/server/functions/createSourceProcedures.md +1 -1
- package/docs/api/server/functions/dataView.md +1 -1
- package/docs/api/server/functions/field.md +1 -1
- package/docs/api/server/functions/getNestedSelection.md +1 -1
- package/docs/api/server/functions/getScopedArgs.md +1 -1
- package/docs/api/server/functions/hasNestedSelection.md +1 -1
- package/docs/api/server/functions/list.md +1 -1
- package/docs/api/server/functions/refetchSourceById.md +1 -1
- package/docs/api/server/functions/resolveSourceById.md +1 -1
- package/docs/api/server/functions/resolveSourceByIds.md +1 -1
- package/docs/api/server/functions/resolveSourceConnection.md +1 -1
- package/docs/api/server/functions/resolver.md +1 -1
- package/docs/api/server/functions/toPrismaSelect.md +1 -1
- package/docs/api/server/functions/withConnection.md +1 -1
- package/docs/api/server/prisma/functions/createPrismaFate.md +1 -1
- package/docs/api/server/prisma/functions/createPrismaSourceAdapter.md +1 -1
- package/docs/api/server/prisma/functions/createPrismaSourceRegistry.md +1 -1
- package/docs/api/server/prisma/functions/prismaConnectionArgs.md +1 -1
- package/docs/api/server/prisma/type-aliases/PrismaDelegate.md +4 -4
- package/docs/api/server/prisma/type-aliases/PrismaQueryExtra.md +1 -1
- package/docs/api/server/prisma/type-aliases/PrismaSourceAdapter.md +9 -9
- package/docs/api/server/prisma/type-aliases/PrismaViewConfig.md +1 -1
- package/docs/api/server/type-aliases/ComputedField.md +5 -5
- package/docs/api/server/type-aliases/ComputedSelection.md +1 -1
- package/docs/api/server/type-aliases/ConnectionItem.md +3 -3
- package/docs/api/server/type-aliases/ConnectionPagination.md +5 -5
- package/docs/api/server/type-aliases/ConnectionResult.md +3 -3
- package/docs/api/server/type-aliases/CountSelection.md +4 -4
- package/docs/api/server/type-aliases/CountWhere.md +1 -1
- package/docs/api/server/type-aliases/DataViewListOptions.md +2 -2
- package/docs/api/server/type-aliases/DataViewOrderBy.md +1 -1
- package/docs/api/server/type-aliases/DataViewOrderDirection.md +1 -1
- package/docs/api/server/type-aliases/DataViewResult.md +1 -1
- package/docs/api/server/type-aliases/Entity.md +1 -1
- package/docs/api/server/type-aliases/FateServer.md +5 -5
- package/docs/api/server/type-aliases/FateServerManifest.md +1 -1
- package/docs/api/server/type-aliases/FieldSelection.md +3 -3
- package/docs/api/server/type-aliases/LiveConnectionEventType.md +1 -1
- package/docs/api/server/type-aliases/LiveConnectionSourceEvent.md +1 -1
- package/docs/api/server/type-aliases/LiveEventBus.md +1 -1
- package/docs/api/server/type-aliases/LiveEventType.md +1 -1
- package/docs/api/server/type-aliases/LiveSourceEvent.md +1 -1
- package/docs/api/server/type-aliases/NativeFateAPI.md +4 -4
- package/docs/api/server/type-aliases/OrderDirection.md +1 -1
- package/docs/api/server/type-aliases/SourceConfig.md +6 -6
- package/docs/api/server/type-aliases/SourceDefinition.md +6 -6
- package/docs/api/server/type-aliases/SourceOrder.md +1 -1
- package/docs/api/server/type-aliases/SourceOrderField.md +3 -3
- package/docs/api/server/type-aliases/SourcePlan.md +1 -1
- package/docs/api/server/type-aliases/SourcePlanNode.md +1 -1
- package/docs/api/server/type-aliases/SourceRegistry.md +1 -1
- package/docs/api/server/type-aliases/SourceRelation.md +1 -1
- package/docs/api/server/type-aliases/SourceRelationConfig.md +1 -1
- package/docs/api/server/variables/byIdInput.md +1 -1
- package/docs/api/server/variables/connectionArgs.md +1 -1
- package/docs/api/type-aliases/ConnectionMetadata.md +1 -1
- package/docs/api/type-aliases/ConnectionRef.md +1 -1
- package/docs/api/type-aliases/Entity.md +2 -2
- package/docs/api/type-aliases/EntityId.md +1 -1
- package/docs/api/type-aliases/FateDehydratedState.md +11 -0
- package/docs/api/type-aliases/FateLiveConnectionEvent.md +1 -1
- package/docs/api/type-aliases/FateLiveEvent.md +1 -1
- package/docs/api/type-aliases/FateMutations.md +1 -1
- package/docs/api/type-aliases/FateOperation.md +1 -1
- package/docs/api/type-aliases/FateProtocolRequest.md +1 -1
- package/docs/api/type-aliases/FateProtocolResponse.md +1 -1
- package/docs/api/type-aliases/FateRecord.md +1 -1
- package/docs/api/type-aliases/FateRoots.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationDefinition.md +19 -0
- package/docs/api/type-aliases/GraphQLMutationInput.md +11 -0
- package/docs/api/type-aliases/GraphQLMutationMap.md +11 -0
- package/docs/api/type-aliases/GraphQLMutationOutput.md +11 -0
- package/docs/api/type-aliases/GraphQLTransportOptions.md +119 -0
- package/docs/api/type-aliases/HydrateOptions.md +7 -0
- package/docs/api/type-aliases/HydrationLimits.md +7 -0
- package/docs/api/type-aliases/InferFateAPI.md +1 -1
- package/docs/api/type-aliases/List.md +1 -1
- package/docs/api/type-aliases/ListEntry.md +1 -1
- package/docs/api/type-aliases/ListItem.md +1 -1
- package/docs/api/type-aliases/Mask.md +1 -1
- package/docs/api/type-aliases/MutationDefinition.md +1 -1
- package/docs/api/type-aliases/MutationEntity.md +1 -1
- package/docs/api/type-aliases/MutationIdentifier.md +1 -1
- package/docs/api/type-aliases/MutationInput.md +1 -1
- package/docs/api/type-aliases/MutationResult.md +1 -1
- package/docs/api/type-aliases/NodesItem.md +1 -1
- package/docs/api/type-aliases/Pagination.md +5 -5
- package/docs/api/type-aliases/Request.md +1 -1
- package/docs/api/type-aliases/RequestMode.md +1 -1
- package/docs/api/type-aliases/RequestOptions.md +1 -1
- package/docs/api/type-aliases/RequestResult.md +1 -1
- package/docs/api/type-aliases/Selection.md +1 -1
- package/docs/api/type-aliases/Snapshot.md +1 -1
- package/docs/api/type-aliases/TypeConfig.md +4 -4
- package/docs/api/type-aliases/View.md +1 -1
- package/docs/api/type-aliases/ViewData.md +1 -1
- package/docs/api/type-aliases/ViewEntity.md +1 -1
- package/docs/api/type-aliases/ViewEntityName.md +1 -1
- package/docs/api/type-aliases/ViewRef.md +1 -1
- package/docs/api/type-aliases/ViewSelection.md +1 -1
- package/docs/api/type-aliases/ViewSnapshot.md +1 -1
- package/docs/api/type-aliases/ViewTag.md +1 -1
- package/docs/api/variables/ConnectionTag.md +1 -1
- package/docs/guide/getting-started.md +1 -1
- package/docs/guide/graphql-integration.md +298 -0
- package/docs/guide/requests.md +52 -0
- package/docs/guide/server-integration.md +2 -1
- package/lib/{executor-BqwHdN3n.d.mts → executor-sLcAqDMs.d.mts} +1 -1
- package/lib/graphqlTransport-DbRHbYtb.d.mts +74 -0
- package/lib/graphqlTransport-IFgmY-Qq.mjs +499 -0
- package/lib/graphqlTransport.d.mts +2 -0
- package/lib/graphqlTransport.mjs +2 -0
- package/lib/index.d.mts +5 -4
- package/lib/index.mjs +501 -89
- package/lib/{list-4wRNSVgI.d.mts → list-CMQOQGdn.d.mts} +1 -1
- package/lib/list.d.mts +1 -1
- package/lib/list.mjs +1 -1
- package/lib/{liveTopics-DzNtJaBD.mjs → liveTopics-JIDh3t3P.mjs} +1 -1
- package/lib/{record-CirbfZWX.d.mts → record-BtdKzEGI.d.mts} +2 -2
- package/lib/server/drizzle.d.mts +6 -8
- package/lib/server/drizzle.mjs +2 -2
- package/lib/server/prisma.d.mts +6 -8
- package/lib/server/prisma.mjs +2 -2
- package/lib/server.d.mts +3 -3
- package/lib/server.mjs +3 -3
- package/lib/{sourceRouter-C22uFcZg.mjs → sourceRouter-N9Vp0Cj6.mjs} +1 -1
- package/lib/{types-Dz46PXr3.d.mts → transport-BTgtSwOM.d.mts} +211 -143
- package/lib/vite.d.mts +1 -1
- package/lib/vite.mjs +150 -3
- package/package.json +11 -3
- /package/lib/{list-C_mi6GnE.mjs → list-_6fXYLtJ.mjs} +0 -0
- /package/lib/{record-AeZJC9fd.mjs → record-B07VwXd-.mjs} +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { E as TypeConfig, s as Entity, t as Transport, v as MutationShape } from "./transport-BTgtSwOM.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/graphqlTransport.d.ts
|
|
4
|
+
type TransportMutations = Record<string, MutationShape>;
|
|
5
|
+
type EmptyTransportMutations = Record<never, MutationShape>;
|
|
6
|
+
type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
7
|
+
type HeadersFactory = HeadersInit | (() => HeadersInit | Promise<HeadersInit>);
|
|
8
|
+
type EventSourceConstructor = new (url: string, options?: {
|
|
9
|
+
withCredentials?: boolean;
|
|
10
|
+
}) => {
|
|
11
|
+
addEventListener(type: string, listener: (event: Event) => void): void;
|
|
12
|
+
close(): void;
|
|
13
|
+
removeEventListener(type: string, listener: (event: Event) => void): void;
|
|
14
|
+
};
|
|
15
|
+
type GraphQLRootConfig = {
|
|
16
|
+
connection?: 'relay';
|
|
17
|
+
field?: string;
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
type GraphQLMutationDefinition<T extends Entity = Entity, Input = unknown, Output = unknown> = Readonly<{
|
|
21
|
+
__fateGraphQLMutation?: {
|
|
22
|
+
input: Input;
|
|
23
|
+
output: Output;
|
|
24
|
+
};
|
|
25
|
+
entity: T['__typename'];
|
|
26
|
+
field: string;
|
|
27
|
+
inputArg?: false | string;
|
|
28
|
+
}>;
|
|
29
|
+
type GraphQLMutationInput<Definition> = Definition extends GraphQLMutationDefinition<any, infer Input, any> ? Input : never;
|
|
30
|
+
type GraphQLMutationOutput<Definition> = Definition extends GraphQLMutationDefinition<any, any, infer Output> ? Output : never;
|
|
31
|
+
type GraphQLMutationMap<Mutations> = Mutations extends Record<string, GraphQLMutationDefinition> ? { [K in keyof Mutations]: {
|
|
32
|
+
input: GraphQLMutationInput<Mutations[K]>;
|
|
33
|
+
output: GraphQLMutationOutput<Mutations[K]>;
|
|
34
|
+
} } : EmptyTransportMutations;
|
|
35
|
+
type GraphQLMutationRuntimeConfig = {
|
|
36
|
+
entity: string;
|
|
37
|
+
field: string;
|
|
38
|
+
inputArg?: false | string;
|
|
39
|
+
};
|
|
40
|
+
type GraphQLLiveOptions = {
|
|
41
|
+
connectionField?: string;
|
|
42
|
+
entityField?: string;
|
|
43
|
+
url?: string | URL;
|
|
44
|
+
withCredentials?: boolean;
|
|
45
|
+
};
|
|
46
|
+
type GraphQLTransportOptions<Mutations extends TransportMutations = EmptyTransportMutations> = {
|
|
47
|
+
decodeNodeId?: (type: string, id: string | number) => string | number;
|
|
48
|
+
encodeNodeId?: (type: string, id: string | number) => string | number;
|
|
49
|
+
eventSource?: EventSourceConstructor;
|
|
50
|
+
fetch?: FetchLike;
|
|
51
|
+
headers?: HeadersFactory;
|
|
52
|
+
live?: boolean | GraphQLLiveOptions;
|
|
53
|
+
mutations?: Record<Extract<keyof Mutations, string>, GraphQLMutationRuntimeConfig>;
|
|
54
|
+
roots?: Record<string, GraphQLRootConfig>;
|
|
55
|
+
types: ReadonlyArray<Omit<TypeConfig, 'getId'> & Partial<Pick<TypeConfig, 'getId'>>>;
|
|
56
|
+
url: string | URL;
|
|
57
|
+
};
|
|
58
|
+
declare function graphqlMutation<T extends Entity, Input, Output>(entity: T['__typename'], options: {
|
|
59
|
+
field: string;
|
|
60
|
+
inputArg?: false | string;
|
|
61
|
+
}): GraphQLMutationDefinition<T, Input, Output>;
|
|
62
|
+
declare function createGraphQLTransport<Mutations extends TransportMutations = EmptyTransportMutations>({
|
|
63
|
+
decodeNodeId,
|
|
64
|
+
encodeNodeId,
|
|
65
|
+
fetch: fetchImpl,
|
|
66
|
+
headers,
|
|
67
|
+
live,
|
|
68
|
+
mutations,
|
|
69
|
+
roots,
|
|
70
|
+
types: typeConfigs,
|
|
71
|
+
url
|
|
72
|
+
}: GraphQLTransportOptions<Mutations>): Transport<Mutations>;
|
|
73
|
+
//#endregion
|
|
74
|
+
export { GraphQLTransportOptions as a, GraphQLMutationOutput as i, GraphQLMutationInput as n, createGraphQLTransport as o, GraphQLMutationMap as r, graphqlMutation as s, GraphQLMutationDefinition as t };
|
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
import { t as isRecord } from "./record-B07VwXd-.mjs";
|
|
2
|
+
//#region src/graphqlTransport.ts
|
|
3
|
+
const defaultFetch = (input, init) => globalThis.fetch(input, init);
|
|
4
|
+
const importGraphQLSSE = () => import("graphql-sse");
|
|
5
|
+
const normalizeEndpoint = (url) => String(url).replace(/\/$/, "");
|
|
6
|
+
const resolveHeaders = async (headers) => typeof headers === "function" ? await headers() : headers ?? {};
|
|
7
|
+
const requestHeaders = async (defaults, headers) => {
|
|
8
|
+
const result = new Headers(defaults);
|
|
9
|
+
new Headers(await resolveHeaders(headers)).forEach((value, key) => {
|
|
10
|
+
result.set(key, value);
|
|
11
|
+
});
|
|
12
|
+
return result;
|
|
13
|
+
};
|
|
14
|
+
const headersToRecord = (headers) => {
|
|
15
|
+
const result = {};
|
|
16
|
+
headers.forEach((value, key) => {
|
|
17
|
+
result[key] = value;
|
|
18
|
+
});
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
const assertIdentifier = (value, context) => {
|
|
22
|
+
if (!/^[_A-Za-z][_0-9A-Za-z]*$/.test(value)) throw new Error(`fate(graphql): Invalid GraphQL ${context} '${value}'.`);
|
|
23
|
+
return value;
|
|
24
|
+
};
|
|
25
|
+
const defaultEncodeNodeId = (type, id) => `${type}-${id}`;
|
|
26
|
+
const defaultDecodeNodeId = (type, id) => {
|
|
27
|
+
if (typeof id !== "string") return id;
|
|
28
|
+
const prefix = `${type}-`;
|
|
29
|
+
return id.startsWith(prefix) ? id.slice(prefix.length) : id;
|
|
30
|
+
};
|
|
31
|
+
const errorCodeFromGraphQL = (error) => {
|
|
32
|
+
const code = error?.extensions?.code;
|
|
33
|
+
return typeof code === "string" ? code : "INTERNAL_ERROR";
|
|
34
|
+
};
|
|
35
|
+
const responseError = async (response) => {
|
|
36
|
+
let message = response.statusText || `HTTP ${response.status}`;
|
|
37
|
+
try {
|
|
38
|
+
const payload = await response.clone().json();
|
|
39
|
+
if (payload.errors?.[0]?.message) message = payload.errors[0].message;
|
|
40
|
+
} catch {
|
|
41
|
+
try {
|
|
42
|
+
const text = await response.text();
|
|
43
|
+
if (text) message = text;
|
|
44
|
+
} catch {}
|
|
45
|
+
}
|
|
46
|
+
return new Error(message);
|
|
47
|
+
};
|
|
48
|
+
const assertGraphQLResponse = (value) => {
|
|
49
|
+
if (!isRecord(value)) throw new Error("fate(graphql): Invalid GraphQL response.");
|
|
50
|
+
return value;
|
|
51
|
+
};
|
|
52
|
+
const graphQLLiteral = (value) => {
|
|
53
|
+
if (value === null) return "null";
|
|
54
|
+
const type = typeof value;
|
|
55
|
+
if (type === "string") return JSON.stringify(value);
|
|
56
|
+
if (type === "number" || type === "boolean") return String(value);
|
|
57
|
+
if (Array.isArray(value)) return `[${value.map(graphQLLiteral).join(", ")}]`;
|
|
58
|
+
if (isRecord(value)) return `{ ${Object.entries(value).map(([key, entry]) => `${assertIdentifier(key, "argument")}: ${graphQLLiteral(entry)}`).join(", ")} }`;
|
|
59
|
+
if (value === void 0) return "null";
|
|
60
|
+
throw new Error(`fate(graphql): Cannot serialize GraphQL argument of type '${type}'.`);
|
|
61
|
+
};
|
|
62
|
+
const argsToGraphQL = (args) => {
|
|
63
|
+
const entries = args ? Object.entries(args).filter(([, value]) => value !== void 0) : [];
|
|
64
|
+
if (entries.length === 0) return "";
|
|
65
|
+
return `(${entries.map(([key, value]) => `${assertIdentifier(key, "argument")}: ${graphQLLiteral(value)}`).join(", ")})`;
|
|
66
|
+
};
|
|
67
|
+
const getArgsAtPath = (args, path) => {
|
|
68
|
+
if (!args) return;
|
|
69
|
+
if (!path) return args;
|
|
70
|
+
let current = args;
|
|
71
|
+
for (const segment of path.split(".")) {
|
|
72
|
+
if (!isRecord(current)) return;
|
|
73
|
+
current = current[segment];
|
|
74
|
+
}
|
|
75
|
+
return isRecord(current) ? current : void 0;
|
|
76
|
+
};
|
|
77
|
+
const getTypeConfig = (types, type) => {
|
|
78
|
+
const config = types.get(type);
|
|
79
|
+
if (!config) throw new Error(`fate(graphql): Unknown entity type '${type}'.`);
|
|
80
|
+
return config;
|
|
81
|
+
};
|
|
82
|
+
const rootArgsToGraphQL = ({ args, type, types }) => {
|
|
83
|
+
if (!args) return "";
|
|
84
|
+
const fields = getTypeConfig(types, type).fields ?? {};
|
|
85
|
+
return argsToGraphQL(Object.fromEntries(Object.entries(args).filter(([key]) => {
|
|
86
|
+
const descriptor = fields[key];
|
|
87
|
+
return !(descriptor && typeof descriptor === "object" && ("listOf" in descriptor || "type" in descriptor));
|
|
88
|
+
})));
|
|
89
|
+
};
|
|
90
|
+
const buildSelectionTree = (select) => {
|
|
91
|
+
const root = /* @__PURE__ */ new Map();
|
|
92
|
+
for (const path of select) {
|
|
93
|
+
let current = root;
|
|
94
|
+
for (const segment of path.split(".")) {
|
|
95
|
+
if (!segment) continue;
|
|
96
|
+
let next = current.get(segment);
|
|
97
|
+
if (!next) {
|
|
98
|
+
next = /* @__PURE__ */ new Map();
|
|
99
|
+
current.set(segment, next);
|
|
100
|
+
}
|
|
101
|
+
current = next;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return root;
|
|
105
|
+
};
|
|
106
|
+
const buildRecordSelection = ({ args, path, select, type, types }) => {
|
|
107
|
+
const tree = buildSelectionTree(select);
|
|
108
|
+
const walk = (currentType, currentTree, currentPath) => {
|
|
109
|
+
const config = getTypeConfig(types, currentType);
|
|
110
|
+
const fields = new Set([
|
|
111
|
+
...currentTree.keys(),
|
|
112
|
+
"id",
|
|
113
|
+
"__typename"
|
|
114
|
+
]);
|
|
115
|
+
const lines = [];
|
|
116
|
+
for (const field of [...fields].sort()) {
|
|
117
|
+
if (field === "__typename") {
|
|
118
|
+
lines.push("__typename");
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
const childTree = currentTree.get(field) ?? /* @__PURE__ */ new Map();
|
|
122
|
+
const descriptor = config.fields?.[field];
|
|
123
|
+
const fieldPath = currentPath ? `${currentPath}.${field}` : field;
|
|
124
|
+
const fieldName = assertIdentifier(field, "field");
|
|
125
|
+
if (descriptor && typeof descriptor === "object" && "type" in descriptor) {
|
|
126
|
+
lines.push(`${fieldName}${argsToGraphQL(getArgsAtPath(args, fieldPath))} { ${walk(descriptor.type, childTree, fieldPath)} }`);
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (descriptor && typeof descriptor === "object" && "listOf" in descriptor) {
|
|
130
|
+
lines.push(`${fieldName}${argsToGraphQL(getArgsAtPath(args, fieldPath))} { edges { cursor node { ${walk(descriptor.listOf, childTree, fieldPath)} } } pageInfo { endCursor hasNextPage hasPreviousPage startCursor } }`);
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
lines.push(fieldName);
|
|
134
|
+
}
|
|
135
|
+
return lines.join(" ");
|
|
136
|
+
};
|
|
137
|
+
return walk(type, tree, path);
|
|
138
|
+
};
|
|
139
|
+
const relayToFateConnection = (value) => {
|
|
140
|
+
if (!isRecord(value) || !Array.isArray(value.edges)) return value;
|
|
141
|
+
const pageInfo = isRecord(value.pageInfo) ? value.pageInfo : {};
|
|
142
|
+
return {
|
|
143
|
+
items: value.edges.flatMap((edge) => isRecord(edge) ? [{
|
|
144
|
+
cursor: typeof edge.cursor === "string" ? edge.cursor : void 0,
|
|
145
|
+
node: edge.node
|
|
146
|
+
}] : []),
|
|
147
|
+
pagination: {
|
|
148
|
+
hasNext: pageInfo.hasNextPage === true,
|
|
149
|
+
hasPrevious: pageInfo.hasPreviousPage === true,
|
|
150
|
+
nextCursor: typeof pageInfo.endCursor === "string" ? pageInfo.endCursor : void 0,
|
|
151
|
+
previousCursor: typeof pageInfo.startCursor === "string" ? pageInfo.startCursor : void 0
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
const normalizeGraphQLValue = ({ decodeNodeId, type, types, value }) => {
|
|
156
|
+
if (Array.isArray(value)) return value.map((entry) => normalizeGraphQLValue({
|
|
157
|
+
decodeNodeId,
|
|
158
|
+
types,
|
|
159
|
+
value: entry
|
|
160
|
+
}));
|
|
161
|
+
const connection = relayToFateConnection(value);
|
|
162
|
+
if (connection !== value) {
|
|
163
|
+
const connectionRecord = connection;
|
|
164
|
+
return {
|
|
165
|
+
...connectionRecord,
|
|
166
|
+
items: connectionRecord.items.map((entry) => ({
|
|
167
|
+
...entry,
|
|
168
|
+
node: normalizeGraphQLValue({
|
|
169
|
+
decodeNodeId,
|
|
170
|
+
types,
|
|
171
|
+
value: entry.node
|
|
172
|
+
})
|
|
173
|
+
}))
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
if (!isRecord(value)) return value;
|
|
177
|
+
const typename = typeof value.__typename === "string" ? value.__typename : type;
|
|
178
|
+
const config = typename ? types.get(typename) : void 0;
|
|
179
|
+
const result = {};
|
|
180
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
181
|
+
if (key === "id" && typename && (typeof entry === "string" || typeof entry === "number")) {
|
|
182
|
+
result.id = decodeNodeId(typename, entry);
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
const descriptor = config?.fields?.[key];
|
|
186
|
+
if (descriptor && typeof descriptor === "object" && "type" in descriptor) {
|
|
187
|
+
result[key] = normalizeGraphQLValue({
|
|
188
|
+
decodeNodeId,
|
|
189
|
+
type: descriptor.type,
|
|
190
|
+
types,
|
|
191
|
+
value: entry
|
|
192
|
+
});
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
result[key] = normalizeGraphQLValue({
|
|
196
|
+
decodeNodeId,
|
|
197
|
+
types,
|
|
198
|
+
value: entry
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
return result;
|
|
202
|
+
};
|
|
203
|
+
const graphQLRequest = async ({ fetchImpl, headers, query, url }) => {
|
|
204
|
+
const response = await fetchImpl(url, {
|
|
205
|
+
body: JSON.stringify({ query }),
|
|
206
|
+
headers: await requestHeaders({ "content-type": "application/json" }, headers),
|
|
207
|
+
method: "POST"
|
|
208
|
+
});
|
|
209
|
+
if (!response.ok) throw await responseError(response);
|
|
210
|
+
const payload = assertGraphQLResponse(await response.json());
|
|
211
|
+
return {
|
|
212
|
+
data: isRecord(payload.data) ? payload.data : {},
|
|
213
|
+
errors: payload.errors ?? []
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
const graphQLError = (error) => {
|
|
217
|
+
const code = errorCodeFromGraphQL(error);
|
|
218
|
+
return new Error(error?.message ?? `GraphQL ${code}`);
|
|
219
|
+
};
|
|
220
|
+
const reportExecutionError = (result, handlers) => {
|
|
221
|
+
if (!result?.errors?.length) return false;
|
|
222
|
+
handlers.onError?.(new Error(result.errors[0]?.message ?? "GraphQL subscription error."));
|
|
223
|
+
return true;
|
|
224
|
+
};
|
|
225
|
+
function graphqlMutation(entity, options) {
|
|
226
|
+
return Object.freeze({
|
|
227
|
+
entity,
|
|
228
|
+
field: options.field,
|
|
229
|
+
inputArg: options.inputArg
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
function createGraphQLTransport({ decodeNodeId = defaultDecodeNodeId, encodeNodeId = defaultEncodeNodeId, fetch: fetchImpl = defaultFetch, headers, live = true, mutations, roots, types: typeConfigs, url }) {
|
|
233
|
+
const endpoint = normalizeEndpoint(url);
|
|
234
|
+
const types = new Map(typeConfigs.map((type) => [type.type, type]));
|
|
235
|
+
let nextId = 0;
|
|
236
|
+
let pending = [];
|
|
237
|
+
let scheduled = false;
|
|
238
|
+
let graphQLLiveClient;
|
|
239
|
+
let graphQLSSEModule;
|
|
240
|
+
const enqueue = (operation) => new Promise((resolve, reject) => {
|
|
241
|
+
pending.push({
|
|
242
|
+
...operation,
|
|
243
|
+
alias: `f${++nextId}`,
|
|
244
|
+
reject,
|
|
245
|
+
resolve
|
|
246
|
+
});
|
|
247
|
+
if (!scheduled) {
|
|
248
|
+
scheduled = true;
|
|
249
|
+
queueMicrotask(flush);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
const flush = async () => {
|
|
253
|
+
scheduled = false;
|
|
254
|
+
const batch = pending;
|
|
255
|
+
pending = [];
|
|
256
|
+
if (!batch.length) return;
|
|
257
|
+
await Promise.all(["query", "mutation"].map(async (kind) => {
|
|
258
|
+
const operations = batch.filter((entry) => entry.kind === kind);
|
|
259
|
+
if (operations.length === 0) return;
|
|
260
|
+
try {
|
|
261
|
+
const { data, errors } = await graphQLRequest({
|
|
262
|
+
fetchImpl,
|
|
263
|
+
headers,
|
|
264
|
+
query: `${kind} Fate${kind === "query" ? "Query" : "Mutation"} { ${operations.map((entry) => `${entry.alias}: ${entry.selection}`).join(" ")} }`,
|
|
265
|
+
url: endpoint
|
|
266
|
+
});
|
|
267
|
+
const aliases = new Set(operations.map((operation) => operation.alias));
|
|
268
|
+
const errorsByAlias = /* @__PURE__ */ new Map();
|
|
269
|
+
const globalErrors = [];
|
|
270
|
+
for (const error of errors) {
|
|
271
|
+
const alias = typeof error.path?.[0] === "string" ? error.path[0] : void 0;
|
|
272
|
+
if (alias && aliases.has(alias)) {
|
|
273
|
+
const aliasErrors = errorsByAlias.get(alias) ?? [];
|
|
274
|
+
aliasErrors.push(error);
|
|
275
|
+
errorsByAlias.set(alias, aliasErrors);
|
|
276
|
+
} else globalErrors.push(error);
|
|
277
|
+
}
|
|
278
|
+
if (globalErrors.length) throw graphQLError(globalErrors[0]);
|
|
279
|
+
for (const operation of operations) {
|
|
280
|
+
const operationErrors = errorsByAlias.get(operation.alias);
|
|
281
|
+
if (operationErrors?.length) {
|
|
282
|
+
operation.reject(graphQLError(operationErrors[0]));
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
operation.resolve(operation.transform(data[operation.alias]));
|
|
286
|
+
}
|
|
287
|
+
} catch (error) {
|
|
288
|
+
for (const operation of operations) operation.reject(error);
|
|
289
|
+
}
|
|
290
|
+
}));
|
|
291
|
+
};
|
|
292
|
+
const transport = {
|
|
293
|
+
fetchById(type, ids, select, args) {
|
|
294
|
+
const globalIds = ids.map((id) => encodeNodeId(type, id));
|
|
295
|
+
const selection = buildRecordSelection({
|
|
296
|
+
args,
|
|
297
|
+
path: "",
|
|
298
|
+
select,
|
|
299
|
+
type,
|
|
300
|
+
types
|
|
301
|
+
});
|
|
302
|
+
return enqueue({
|
|
303
|
+
kind: "query",
|
|
304
|
+
selection: `nodes(ids: ${graphQLLiteral(globalIds)}) { ... on ${assertIdentifier(type, "type")} { ${selection} } }`,
|
|
305
|
+
transform: (value) => (Array.isArray(value) ? value : []).filter(Boolean).map((entry) => normalizeGraphQLValue({
|
|
306
|
+
decodeNodeId,
|
|
307
|
+
type,
|
|
308
|
+
types,
|
|
309
|
+
value: entry
|
|
310
|
+
}))
|
|
311
|
+
});
|
|
312
|
+
},
|
|
313
|
+
fetchList(name, select, args) {
|
|
314
|
+
const root = roots?.[name];
|
|
315
|
+
if (!root) throw new Error(`fate(graphql): Missing root list mapping for '${name}'.`);
|
|
316
|
+
const field = assertIdentifier(root.field ?? name, "field");
|
|
317
|
+
const selection = buildRecordSelection({
|
|
318
|
+
args,
|
|
319
|
+
path: "",
|
|
320
|
+
select,
|
|
321
|
+
type: root.type,
|
|
322
|
+
types
|
|
323
|
+
});
|
|
324
|
+
return enqueue({
|
|
325
|
+
kind: "query",
|
|
326
|
+
selection: `${field}${rootArgsToGraphQL({
|
|
327
|
+
args,
|
|
328
|
+
type: root.type,
|
|
329
|
+
types
|
|
330
|
+
})} { edges { cursor node { ${selection} } } pageInfo { endCursor hasNextPage hasPreviousPage startCursor } }`,
|
|
331
|
+
transform: (value) => normalizeGraphQLValue({
|
|
332
|
+
decodeNodeId,
|
|
333
|
+
type: root.type,
|
|
334
|
+
types,
|
|
335
|
+
value
|
|
336
|
+
})
|
|
337
|
+
});
|
|
338
|
+
},
|
|
339
|
+
fetchQuery(name, select, args) {
|
|
340
|
+
const root = roots?.[name];
|
|
341
|
+
if (!root) throw new Error(`fate(graphql): Missing root query mapping for '${name}'.`);
|
|
342
|
+
const field = assertIdentifier(root.field ?? name, "field");
|
|
343
|
+
const selection = buildRecordSelection({
|
|
344
|
+
args,
|
|
345
|
+
path: "",
|
|
346
|
+
select,
|
|
347
|
+
type: root.type,
|
|
348
|
+
types
|
|
349
|
+
});
|
|
350
|
+
return enqueue({
|
|
351
|
+
kind: "query",
|
|
352
|
+
selection: `${field}${rootArgsToGraphQL({
|
|
353
|
+
args,
|
|
354
|
+
type: root.type,
|
|
355
|
+
types
|
|
356
|
+
})} { ${selection} }`,
|
|
357
|
+
transform: (value) => normalizeGraphQLValue({
|
|
358
|
+
decodeNodeId,
|
|
359
|
+
type: root.type,
|
|
360
|
+
types,
|
|
361
|
+
value
|
|
362
|
+
})
|
|
363
|
+
});
|
|
364
|
+
},
|
|
365
|
+
mutate(name, input, select) {
|
|
366
|
+
const mutation = mutations?.[name];
|
|
367
|
+
if (!mutation) throw new Error(`fate(graphql): Missing mutation mapping for '${name}'.`);
|
|
368
|
+
const field = assertIdentifier(mutation.field, "mutation");
|
|
369
|
+
const args = mutation.inputArg === false ? input ?? {} : { [mutation.inputArg ?? "input"]: input };
|
|
370
|
+
const selection = buildRecordSelection({
|
|
371
|
+
args: isRecord(input) && isRecord(input.args) ? input.args : void 0,
|
|
372
|
+
path: "",
|
|
373
|
+
select,
|
|
374
|
+
type: mutation.entity,
|
|
375
|
+
types
|
|
376
|
+
});
|
|
377
|
+
return enqueue({
|
|
378
|
+
kind: "mutation",
|
|
379
|
+
selection: `${field}${argsToGraphQL(args)} { ${selection} }`,
|
|
380
|
+
transform: (value) => normalizeGraphQLValue({
|
|
381
|
+
decodeNodeId,
|
|
382
|
+
type: mutation.entity,
|
|
383
|
+
types,
|
|
384
|
+
value
|
|
385
|
+
})
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
if (live !== false) {
|
|
390
|
+
const liveOptions = typeof live === "object" ? live : {};
|
|
391
|
+
const liveUrl = liveOptions.url ?? `${endpoint}/stream`;
|
|
392
|
+
const getLiveClient = async () => {
|
|
393
|
+
if (graphQLLiveClient) return graphQLLiveClient;
|
|
394
|
+
let graphQLSSE;
|
|
395
|
+
try {
|
|
396
|
+
graphQLSSE = await (graphQLSSEModule ??= importGraphQLSSE());
|
|
397
|
+
} catch (error) {
|
|
398
|
+
throw new Error("fate(graphql): GraphQL live queries require the optional 'graphql-sse' package. Install it or pass live: false.", { cause: error });
|
|
399
|
+
}
|
|
400
|
+
const { createClient } = graphQLSSE;
|
|
401
|
+
return graphQLLiveClient ??= createClient({
|
|
402
|
+
credentials: liveOptions.withCredentials === false ? "same-origin" : "include",
|
|
403
|
+
fetchFn: fetchImpl,
|
|
404
|
+
headers: async () => headersToRecord(await requestHeaders({}, headers)),
|
|
405
|
+
lazy: true,
|
|
406
|
+
singleConnection: true,
|
|
407
|
+
url: String(liveUrl)
|
|
408
|
+
});
|
|
409
|
+
};
|
|
410
|
+
const subscribeLive = (query, sink) => {
|
|
411
|
+
let disposed = false;
|
|
412
|
+
let unsubscribe;
|
|
413
|
+
getLiveClient().then((client) => {
|
|
414
|
+
if (disposed) return;
|
|
415
|
+
unsubscribe = client.subscribe({ query }, sink);
|
|
416
|
+
if (disposed) unsubscribe();
|
|
417
|
+
}).catch((error) => {
|
|
418
|
+
if (!disposed) sink.error(error);
|
|
419
|
+
});
|
|
420
|
+
return () => {
|
|
421
|
+
disposed = true;
|
|
422
|
+
unsubscribe?.();
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
transport.subscribeById = (type, id, select, args, handlers) => {
|
|
426
|
+
const field = assertIdentifier(liveOptions.entityField ?? "fateLiveNode", "subscription");
|
|
427
|
+
return subscribeLive(`subscription FateLiveNode { ${field}(type: ${graphQLLiteral(type)}, id: ${graphQLLiteral(encodeNodeId(type, id))}, select: ${graphQLLiteral([...select])}, args: ${graphQLLiteral(args ?? null)}) { data delete id select } }`, {
|
|
428
|
+
complete() {},
|
|
429
|
+
error: (error) => handlers.onError?.(error),
|
|
430
|
+
next(result) {
|
|
431
|
+
try {
|
|
432
|
+
if (reportExecutionError(result, handlers)) return;
|
|
433
|
+
const value = result.data?.[field];
|
|
434
|
+
if (!isRecord(value)) return;
|
|
435
|
+
const eventPayload = value;
|
|
436
|
+
if (eventPayload.delete) {
|
|
437
|
+
handlers.onDelete?.(eventPayload.id == null ? id : decodeNodeId(type, eventPayload.id));
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
handlers.onData(normalizeGraphQLValue({
|
|
441
|
+
decodeNodeId,
|
|
442
|
+
type,
|
|
443
|
+
types,
|
|
444
|
+
value: eventPayload.data
|
|
445
|
+
}), eventPayload.select);
|
|
446
|
+
} catch (error) {
|
|
447
|
+
handlers.onError?.(error);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
};
|
|
452
|
+
transport.subscribeConnection = (procedure, type, args, select, selectionArgs, handlers) => {
|
|
453
|
+
const field = assertIdentifier(liveOptions.connectionField ?? "fateLiveConnection", "subscription");
|
|
454
|
+
return subscribeLive(`subscription FateLiveConnection { ${field}(procedure: ${graphQLLiteral(procedure)}, type: ${graphQLLiteral(type)}, args: ${graphQLLiteral(args ?? null)}, select: ${graphQLLiteral([...select])}, selectionArgs: ${graphQLLiteral(selectionArgs ?? null)}) { cursor id node nodeType targetCursor type } }`, {
|
|
455
|
+
complete() {},
|
|
456
|
+
error: (error) => handlers.onError?.(error),
|
|
457
|
+
next(result) {
|
|
458
|
+
try {
|
|
459
|
+
if (reportExecutionError(result, handlers)) return;
|
|
460
|
+
const value = result.data?.[field];
|
|
461
|
+
if (!isRecord(value)) return;
|
|
462
|
+
const eventPayload = value;
|
|
463
|
+
if (eventPayload.type === "invalidate") {
|
|
464
|
+
handlers.onEvent({ type: "invalidate" });
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
if (eventPayload.type === "deleteEdge") {
|
|
468
|
+
if (eventPayload.id != null) handlers.onEvent({
|
|
469
|
+
id: decodeNodeId(eventPayload.nodeType ?? type, eventPayload.id),
|
|
470
|
+
nodeType: eventPayload.nodeType ?? type,
|
|
471
|
+
type: "deleteEdge"
|
|
472
|
+
});
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
handlers.onEvent({
|
|
476
|
+
edge: {
|
|
477
|
+
cursor: eventPayload.cursor,
|
|
478
|
+
node: normalizeGraphQLValue({
|
|
479
|
+
decodeNodeId,
|
|
480
|
+
type: eventPayload.nodeType ?? type,
|
|
481
|
+
types,
|
|
482
|
+
value: eventPayload.node
|
|
483
|
+
})
|
|
484
|
+
},
|
|
485
|
+
nodeType: eventPayload.nodeType ?? type,
|
|
486
|
+
targetCursor: eventPayload.targetCursor,
|
|
487
|
+
type: eventPayload.type
|
|
488
|
+
});
|
|
489
|
+
} catch (error) {
|
|
490
|
+
handlers.onError?.(error);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
return transport;
|
|
497
|
+
}
|
|
498
|
+
//#endregion
|
|
499
|
+
export { graphqlMutation as n, createGraphQLTransport as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as GraphQLTransportOptions, i as GraphQLMutationOutput, n as GraphQLMutationInput, o as createGraphQLTransport, r as GraphQLMutationMap, s as graphqlMutation, t as GraphQLMutationDefinition } from "./graphqlTransport-DbRHbYtb.mjs";
|
|
2
|
+
export { GraphQLMutationDefinition, GraphQLMutationInput, GraphQLMutationMap, GraphQLMutationOutput, GraphQLTransportOptions, createGraphQLTransport, graphqlMutation };
|
package/lib/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
1
|
+
import { A as ViewEntity, B as mutation, C as RootDefinition, D as TypeName, E as TypeConfig, F as ViewTag, G as getSelectionPlan, H as RequestMode, I as __FateEntityBrand, J as HydrationLimits, K as FateDehydratedState, L as __FateSelectionBrand, M as ViewRef, N as ViewSelection, O as View, P as ViewSnapshot, R as isViewTag, S as RequestResult, T as Snapshot, U as RequestOptions, V as FateClient, W as createClient, Y as List, _ as MutationResult, a as ConnectionRef, b as Pagination, c as EntityId, d as ListItem, f as Mask, g as MutationInput, h as MutationIdentifier, i as ConnectionMetadata, j as ViewEntityName, k as ViewData, l as FateRoots, m as MutationEntity, n as createTRPCTransport, o as ConnectionTag, p as MutationDefinition, q as HydrateOptions, r as AnyRecord, s as Entity, t as Transport, u as FateThenable, v as MutationShape, w as Selection, x as Request$1, y as NodesItem, z as FateMutations } from "./transport-BTgtSwOM.mjs";
|
|
2
|
+
import { a as GraphQLTransportOptions, i as GraphQLMutationOutput, n as GraphQLMutationInput, o as createGraphQLTransport, r as GraphQLMutationMap, s as graphqlMutation, t as GraphQLMutationDefinition } from "./graphqlTransport-DbRHbYtb.mjs";
|
|
3
|
+
import { C as liveGlobalConnectionTopic, S as liveEntityTopic, a as FateProtocolRequest, i as FateOperation, n as FateLiveConnectionEvent, o as FateProtocolResponse, r as FateLiveEvent, t as isRecord, u as InferFateAPI, x as liveConnectionTopic } from "./record-BtdKzEGI.mjs";
|
|
4
|
+
import { n as getListEntries, t as ListEntry } from "./list-CMQOQGdn.mjs";
|
|
4
5
|
|
|
5
6
|
//#region src/httpTransport.d.ts
|
|
6
7
|
type TransportMutations = Record<string, MutationShape>;
|
|
@@ -87,4 +88,4 @@ type SelectionValidation<T extends Entity, S extends Selection<T>> = Exclude<key
|
|
|
87
88
|
*/
|
|
88
89
|
declare function view<T extends Entity>(): <S extends Selection<T>>(select: S & SelectionValidation<T, S>) => View<T, S>;
|
|
89
90
|
//#endregion
|
|
90
|
-
export { type ConnectionMetadata, type ConnectionRef, ConnectionTag, type Entity, type EntityId, FateClient, type FateLiveConnectionEvent, type FateLiveEvent, type FateMutations, type FateOperation, type FateProtocolRequest, type FateProtocolResponse, type AnyRecord as FateRecord, type FateRoots, type FateThenable, type InferFateAPI, type List, type ListEntry, type ListItem, type Mask, type MutationDefinition, type MutationEntity, type MutationIdentifier, type MutationInput, type MutationResult, type NodesItem, type Pagination, type Request$1 as Request, type RequestMode, type RequestOptions, type RequestResult, type Selection, type Snapshot, type Transport, type TypeConfig, type View, type ViewData, type ViewEntity, type ViewEntityName, type ViewRef, type ViewSelection, type ViewSnapshot, type ViewTag, clientRoot, createClient, createHTTPTransport, createTRPCTransport, getListEntries, getSelectionPlan, isRecord, isViewTag, liveConnectionTopic, liveEntityTopic, liveGlobalConnectionTopic, mutation, toEntityId, view };
|
|
91
|
+
export { type ConnectionMetadata, type ConnectionRef, ConnectionTag, type Entity, type EntityId, FateClient, type FateDehydratedState, type FateLiveConnectionEvent, type FateLiveEvent, type FateMutations, type FateOperation, type FateProtocolRequest, type FateProtocolResponse, type AnyRecord as FateRecord, type FateRoots, type FateThenable, type GraphQLMutationDefinition, type GraphQLMutationInput, type GraphQLMutationMap, type GraphQLMutationOutput, type GraphQLTransportOptions, type HydrateOptions, type HydrationLimits, type InferFateAPI, type List, type ListEntry, type ListItem, type Mask, type MutationDefinition, type MutationEntity, type MutationIdentifier, type MutationInput, type MutationResult, type NodesItem, type Pagination, type Request$1 as Request, type RequestMode, type RequestOptions, type RequestResult, type Selection, type Snapshot, type Transport, type TypeConfig, type View, type ViewData, type ViewEntity, type ViewEntityName, type ViewRef, type ViewSelection, type ViewSnapshot, type ViewTag, clientRoot, createClient, createGraphQLTransport, createHTTPTransport, createTRPCTransport, getListEntries, getSelectionPlan, graphqlMutation, isRecord, isViewTag, liveConnectionTopic, liveEntityTopic, liveGlobalConnectionTopic, mutation, toEntityId, view };
|