@mearie/core 0.0.1-next.4 → 0.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/dist/index.cjs +2 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +2 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -980,7 +980,8 @@ const normalize = (schemaMeta, selections, storage, data, variables, accessor) =
|
|
|
980
980
|
//#region src/cache/denormalize.ts
|
|
981
981
|
const typenameFieldKey = makeFieldKey({
|
|
982
982
|
kind: "Field",
|
|
983
|
-
name: "__typename"
|
|
983
|
+
name: "__typename",
|
|
984
|
+
type: "String"
|
|
984
985
|
}, {});
|
|
985
986
|
const denormalize = (selections, storage, value, variables, accessor) => {
|
|
986
987
|
let partial = false;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Artifact, Artifact as Artifact$1, ArtifactKind, ArtifactKind as ArtifactKind$1, DataOf, FragmentRefs, FragmentRefs as FragmentRefs$1, SchemaMeta, VariablesOf, VariablesOf as VariablesOf$1 } from "@mearie/shared";
|
|
1
|
+
import { Artifact, Artifact as Artifact$1, ArtifactKind, ArtifactKind as ArtifactKind$1, DataOf, FragmentRefs, FragmentRefs as FragmentRefs$1, SchemaMeta, SchemaMeta as SchemaMeta$1, VariablesOf, VariablesOf as VariablesOf$1 } from "@mearie/shared";
|
|
2
2
|
|
|
3
3
|
//#region src/stream/types.d.ts
|
|
4
4
|
/**
|
|
@@ -91,14 +91,14 @@ type ScalarTransformer<TExternal = unknown, TInternal = unknown> = {
|
|
|
91
91
|
parse: (value: TInternal) => TExternal;
|
|
92
92
|
serialize: (value: TExternal) => TInternal;
|
|
93
93
|
};
|
|
94
|
-
type ScalarsConfig<TMeta extends SchemaMeta = SchemaMeta> = { [K in keyof TMeta['scalars']]: ScalarTransformer<TMeta['scalars'][K], unknown> };
|
|
94
|
+
type ScalarsConfig<TMeta extends SchemaMeta$1 = SchemaMeta$1> = { [K in keyof TMeta['scalars']]: ScalarTransformer<TMeta['scalars'][K], unknown> };
|
|
95
95
|
//#endregion
|
|
96
96
|
//#region src/client.d.ts
|
|
97
97
|
type QueryOptions = {};
|
|
98
98
|
type MutationOptions = {};
|
|
99
99
|
type SubscriptionOptions = {};
|
|
100
100
|
type FragmentOptions = {};
|
|
101
|
-
type ClientOptions<T extends SchemaMeta> = {
|
|
101
|
+
type ClientOptions<T extends SchemaMeta$1> = {
|
|
102
102
|
schema: T;
|
|
103
103
|
exchanges: Exchange[];
|
|
104
104
|
} & (T['scalars'] extends Record<string, never> ? {
|
|
@@ -106,7 +106,7 @@ type ClientOptions<T extends SchemaMeta> = {
|
|
|
106
106
|
} : {
|
|
107
107
|
scalars: ScalarsConfig<T>;
|
|
108
108
|
});
|
|
109
|
-
declare class Client<TMeta extends SchemaMeta> {
|
|
109
|
+
declare class Client<TMeta extends SchemaMeta$1 = SchemaMeta$1> {
|
|
110
110
|
#private;
|
|
111
111
|
private operations$;
|
|
112
112
|
private results$;
|
|
@@ -122,7 +122,7 @@ declare class Client<TMeta extends SchemaMeta> {
|
|
|
122
122
|
executeFragment<T extends Artifact$1<'fragment'>>(artifact: T, fragmentRef: FragmentRefs$1<T['name']>, options?: FragmentOptions): Source<OperationResult>;
|
|
123
123
|
dispose(): void;
|
|
124
124
|
}
|
|
125
|
-
declare const createClient: <T extends SchemaMeta>(config: ClientOptions<T>) => Client<T>;
|
|
125
|
+
declare const createClient: <T extends SchemaMeta$1>(config: ClientOptions<T>) => Client<T>;
|
|
126
126
|
//#endregion
|
|
127
127
|
//#region src/exchange.d.ts
|
|
128
128
|
interface OperationMetadataMap {}
|
|
@@ -146,12 +146,12 @@ type OperationResult = {
|
|
|
146
146
|
extensions?: Record<string, unknown>;
|
|
147
147
|
stale?: boolean;
|
|
148
148
|
};
|
|
149
|
-
type ExchangeInput = {
|
|
149
|
+
type ExchangeInput<TMeta extends SchemaMeta$1 = SchemaMeta$1> = {
|
|
150
150
|
forward: ExchangeIO;
|
|
151
|
-
client: Client
|
|
151
|
+
client: Client<TMeta>;
|
|
152
152
|
};
|
|
153
153
|
type ExchangeIO = (operations: Source<Operation>) => Source<OperationResult>;
|
|
154
|
-
type Exchange = (input: ExchangeInput) => ExchangeIO;
|
|
154
|
+
type Exchange = <TMeta extends SchemaMeta$1 = SchemaMeta$1>(input: ExchangeInput<TMeta>) => ExchangeIO;
|
|
155
155
|
//#endregion
|
|
156
156
|
//#region src/exchanges/compose.d.ts
|
|
157
157
|
type ComposeExchangeOptions = {
|
|
@@ -283,4 +283,4 @@ declare const subscriptionExchange: (options: SubscriptionExchangeOptions) => Ex
|
|
|
283
283
|
*/
|
|
284
284
|
declare const stringify: (value: unknown) => string;
|
|
285
285
|
//#endregion
|
|
286
|
-
export { AggregatedError, type Artifact, type ArtifactKind, type CacheOptions, Client, type ClientOptions, type ComposeExchangeOptions, type DataOf, type Exchange, ExchangeError, type ExchangeErrorExtensionsMap, type ExchangeIO, type FragmentOptions, type FragmentRefs, GraphQLError, type HttpOptions, type MutationOptions, type Operation, type OperationError, type OperationMetadataMap, type OperationResult, type QueryOptions, type RetryOptions, type SubscriptionClient, type SubscriptionExchangeOptions, type SubscriptionOptions, type VariablesOf, cacheExchange, composeExchange, createClient, dedupExchange, fragmentExchange, httpExchange, isAggregatedError, isExchangeError, isGraphQLError, retryExchange, stringify, subscriptionExchange };
|
|
286
|
+
export { AggregatedError, type Artifact, type ArtifactKind, type CacheOptions, Client, type ClientOptions, type ComposeExchangeOptions, type DataOf, type Exchange, ExchangeError, type ExchangeErrorExtensionsMap, type ExchangeIO, type FragmentOptions, type FragmentRefs, GraphQLError, type HttpOptions, type MutationOptions, type Operation, type OperationError, type OperationMetadataMap, type OperationResult, type QueryOptions, type RetryOptions, type SchemaMeta, type SubscriptionClient, type SubscriptionExchangeOptions, type SubscriptionOptions, type VariablesOf, cacheExchange, composeExchange, createClient, dedupExchange, fragmentExchange, httpExchange, isAggregatedError, isExchangeError, isGraphQLError, retryExchange, stringify, subscriptionExchange };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Artifact, Artifact as Artifact$1, ArtifactKind, ArtifactKind as ArtifactKind$1, DataOf, FragmentRefs, FragmentRefs as FragmentRefs$1, SchemaMeta, VariablesOf, VariablesOf as VariablesOf$1 } from "@mearie/shared";
|
|
1
|
+
import { Artifact, Artifact as Artifact$1, ArtifactKind, ArtifactKind as ArtifactKind$1, DataOf, FragmentRefs, FragmentRefs as FragmentRefs$1, SchemaMeta, SchemaMeta as SchemaMeta$1, VariablesOf, VariablesOf as VariablesOf$1 } from "@mearie/shared";
|
|
2
2
|
|
|
3
3
|
//#region src/stream/types.d.ts
|
|
4
4
|
/**
|
|
@@ -91,14 +91,14 @@ type ScalarTransformer<TExternal = unknown, TInternal = unknown> = {
|
|
|
91
91
|
parse: (value: TInternal) => TExternal;
|
|
92
92
|
serialize: (value: TExternal) => TInternal;
|
|
93
93
|
};
|
|
94
|
-
type ScalarsConfig<TMeta extends SchemaMeta = SchemaMeta> = { [K in keyof TMeta['scalars']]: ScalarTransformer<TMeta['scalars'][K], unknown> };
|
|
94
|
+
type ScalarsConfig<TMeta extends SchemaMeta$1 = SchemaMeta$1> = { [K in keyof TMeta['scalars']]: ScalarTransformer<TMeta['scalars'][K], unknown> };
|
|
95
95
|
//#endregion
|
|
96
96
|
//#region src/client.d.ts
|
|
97
97
|
type QueryOptions = {};
|
|
98
98
|
type MutationOptions = {};
|
|
99
99
|
type SubscriptionOptions = {};
|
|
100
100
|
type FragmentOptions = {};
|
|
101
|
-
type ClientOptions<T extends SchemaMeta> = {
|
|
101
|
+
type ClientOptions<T extends SchemaMeta$1> = {
|
|
102
102
|
schema: T;
|
|
103
103
|
exchanges: Exchange[];
|
|
104
104
|
} & (T['scalars'] extends Record<string, never> ? {
|
|
@@ -106,7 +106,7 @@ type ClientOptions<T extends SchemaMeta> = {
|
|
|
106
106
|
} : {
|
|
107
107
|
scalars: ScalarsConfig<T>;
|
|
108
108
|
});
|
|
109
|
-
declare class Client<TMeta extends SchemaMeta> {
|
|
109
|
+
declare class Client<TMeta extends SchemaMeta$1 = SchemaMeta$1> {
|
|
110
110
|
#private;
|
|
111
111
|
private operations$;
|
|
112
112
|
private results$;
|
|
@@ -122,7 +122,7 @@ declare class Client<TMeta extends SchemaMeta> {
|
|
|
122
122
|
executeFragment<T extends Artifact$1<'fragment'>>(artifact: T, fragmentRef: FragmentRefs$1<T['name']>, options?: FragmentOptions): Source<OperationResult>;
|
|
123
123
|
dispose(): void;
|
|
124
124
|
}
|
|
125
|
-
declare const createClient: <T extends SchemaMeta>(config: ClientOptions<T>) => Client<T>;
|
|
125
|
+
declare const createClient: <T extends SchemaMeta$1>(config: ClientOptions<T>) => Client<T>;
|
|
126
126
|
//#endregion
|
|
127
127
|
//#region src/exchange.d.ts
|
|
128
128
|
interface OperationMetadataMap {}
|
|
@@ -146,12 +146,12 @@ type OperationResult = {
|
|
|
146
146
|
extensions?: Record<string, unknown>;
|
|
147
147
|
stale?: boolean;
|
|
148
148
|
};
|
|
149
|
-
type ExchangeInput = {
|
|
149
|
+
type ExchangeInput<TMeta extends SchemaMeta$1 = SchemaMeta$1> = {
|
|
150
150
|
forward: ExchangeIO;
|
|
151
|
-
client: Client
|
|
151
|
+
client: Client<TMeta>;
|
|
152
152
|
};
|
|
153
153
|
type ExchangeIO = (operations: Source<Operation>) => Source<OperationResult>;
|
|
154
|
-
type Exchange = (input: ExchangeInput) => ExchangeIO;
|
|
154
|
+
type Exchange = <TMeta extends SchemaMeta$1 = SchemaMeta$1>(input: ExchangeInput<TMeta>) => ExchangeIO;
|
|
155
155
|
//#endregion
|
|
156
156
|
//#region src/exchanges/compose.d.ts
|
|
157
157
|
type ComposeExchangeOptions = {
|
|
@@ -283,4 +283,4 @@ declare const subscriptionExchange: (options: SubscriptionExchangeOptions) => Ex
|
|
|
283
283
|
*/
|
|
284
284
|
declare const stringify: (value: unknown) => string;
|
|
285
285
|
//#endregion
|
|
286
|
-
export { AggregatedError, type Artifact, type ArtifactKind, type CacheOptions, Client, type ClientOptions, type ComposeExchangeOptions, type DataOf, type Exchange, ExchangeError, type ExchangeErrorExtensionsMap, type ExchangeIO, type FragmentOptions, type FragmentRefs, GraphQLError, type HttpOptions, type MutationOptions, type Operation, type OperationError, type OperationMetadataMap, type OperationResult, type QueryOptions, type RetryOptions, type SubscriptionClient, type SubscriptionExchangeOptions, type SubscriptionOptions, type VariablesOf, cacheExchange, composeExchange, createClient, dedupExchange, fragmentExchange, httpExchange, isAggregatedError, isExchangeError, isGraphQLError, retryExchange, stringify, subscriptionExchange };
|
|
286
|
+
export { AggregatedError, type Artifact, type ArtifactKind, type CacheOptions, Client, type ClientOptions, type ComposeExchangeOptions, type DataOf, type Exchange, ExchangeError, type ExchangeErrorExtensionsMap, type ExchangeIO, type FragmentOptions, type FragmentRefs, GraphQLError, type HttpOptions, type MutationOptions, type Operation, type OperationError, type OperationMetadataMap, type OperationResult, type QueryOptions, type RetryOptions, type SchemaMeta, type SubscriptionClient, type SubscriptionExchangeOptions, type SubscriptionOptions, type VariablesOf, cacheExchange, composeExchange, createClient, dedupExchange, fragmentExchange, httpExchange, isAggregatedError, isExchangeError, isGraphQLError, retryExchange, stringify, subscriptionExchange };
|
package/dist/index.js
CHANGED
|
@@ -979,7 +979,8 @@ const normalize = (schemaMeta, selections, storage, data, variables, accessor) =
|
|
|
979
979
|
//#region src/cache/denormalize.ts
|
|
980
980
|
const typenameFieldKey = makeFieldKey({
|
|
981
981
|
kind: "Field",
|
|
982
|
-
name: "__typename"
|
|
982
|
+
name: "__typename",
|
|
983
|
+
type: "String"
|
|
983
984
|
}, {});
|
|
984
985
|
const denormalize = (selections, storage, value, variables, accessor) => {
|
|
985
986
|
let partial = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearie/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Type-safe, zero-overhead GraphQL client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"README.md"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@mearie/shared": "0.
|
|
48
|
+
"@mearie/shared": "0.1.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"tsdown": "^0.15.12",
|