@mearie/react 0.0.1-next.5 → 0.1.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/README.md CHANGED
@@ -21,10 +21,12 @@ First, create a client and wrap your app with the provider:
21
21
 
22
22
  ```tsx
23
23
  // src/App.tsx
24
- import { createClient, httpLink, cacheLink, ClientProvider } from '@mearie/react';
24
+ import { createClient, httpExchange, cacheExchange, dedupExchange, ClientProvider } from '@mearie/react';
25
+ import { schema } from '$mearie';
25
26
 
26
27
  const client = createClient({
27
- links: [cacheLink(), httpLink({ url: 'https://api.example.com/graphql' })],
28
+ schema,
29
+ exchanges: [dedupExchange(), cacheExchange(), httpExchange({ url: 'https://api.example.com/graphql' })],
28
30
  });
29
31
 
30
32
  function App() {
package/dist/index.d.cts CHANGED
@@ -33,7 +33,7 @@ type Query<T extends Artifact<'query'>> = {
33
33
  type UseQueryOptions = QueryOptions & {
34
34
  skip?: boolean;
35
35
  };
36
- declare const useQuery: <T extends Artifact<"query">>(query: T, ...[variables, options]: VariablesOf<T> extends undefined ? [undefined?, UseQueryOptions?] : [VariablesOf<T>, UseQueryOptions?]) => Query<T>;
36
+ declare const useQuery: <T extends Artifact<"query">>(query: T, ...[variables, options]: VariablesOf<T> extends Record<string, never> ? [undefined?, UseQueryOptions?] : [VariablesOf<T>, UseQueryOptions?]) => Query<T>;
37
37
  //#endregion
38
38
  //#region src/use-subscription.d.ts
39
39
  type Subscription<T extends Artifact<'subscription'>> = {
@@ -54,7 +54,7 @@ type UseSubscriptionOptions<T extends Artifact<'subscription'>> = SubscriptionOp
54
54
  onData?: (data: DataOf<T>) => void;
55
55
  onError?: (error: AggregatedError) => void;
56
56
  };
57
- declare const useSubscription: <T extends Artifact<"subscription">>(subscription: T, ...[variables, options]: VariablesOf<T> extends undefined ? [undefined?, UseSubscriptionOptions<T>?] : [VariablesOf<T>, UseSubscriptionOptions<T>?]) => Subscription<T>;
57
+ declare const useSubscription: <T extends Artifact<"subscription">>(subscription: T, ...[variables, options]: VariablesOf<T> extends Record<string, never> ? [undefined?, UseSubscriptionOptions<T>?] : [VariablesOf<T>, UseSubscriptionOptions<T>?]) => Subscription<T>;
58
58
  //#endregion
59
59
  //#region src/use-mutation.d.ts
60
60
  type MutationResult<T extends Artifact<'mutation'>> = {
@@ -71,7 +71,7 @@ type MutationResult<T extends Artifact<'mutation'>> = {
71
71
  error: AggregatedError;
72
72
  };
73
73
  type UseMutationOptions = MutationOptions;
74
- type Mutation<T extends Artifact<'mutation'>> = [(...[variables, options]: VariablesOf<T> extends undefined ? [undefined?, UseMutationOptions?] : [VariablesOf<T>, UseMutationOptions?]) => Promise<DataOf<T>>, MutationResult<T>];
74
+ type Mutation<T extends Artifact<'mutation'>> = [(...[variables, options]: VariablesOf<T> extends Record<string, never> ? [undefined?, UseMutationOptions?] : [VariablesOf<T>, UseMutationOptions?]) => Promise<DataOf<T>>, MutationResult<T>];
75
75
  declare const useMutation: <T extends Artifact<"mutation">>(mutation: T) => Mutation<T>;
76
76
  //#endregion
77
77
  //#region src/use-fragment.d.ts
package/dist/index.d.ts CHANGED
@@ -33,7 +33,7 @@ type Query<T extends Artifact<'query'>> = {
33
33
  type UseQueryOptions = QueryOptions & {
34
34
  skip?: boolean;
35
35
  };
36
- declare const useQuery: <T extends Artifact<"query">>(query: T, ...[variables, options]: VariablesOf<T> extends undefined ? [undefined?, UseQueryOptions?] : [VariablesOf<T>, UseQueryOptions?]) => Query<T>;
36
+ declare const useQuery: <T extends Artifact<"query">>(query: T, ...[variables, options]: VariablesOf<T> extends Record<string, never> ? [undefined?, UseQueryOptions?] : [VariablesOf<T>, UseQueryOptions?]) => Query<T>;
37
37
  //#endregion
38
38
  //#region src/use-subscription.d.ts
39
39
  type Subscription<T extends Artifact<'subscription'>> = {
@@ -54,7 +54,7 @@ type UseSubscriptionOptions<T extends Artifact<'subscription'>> = SubscriptionOp
54
54
  onData?: (data: DataOf<T>) => void;
55
55
  onError?: (error: AggregatedError) => void;
56
56
  };
57
- declare const useSubscription: <T extends Artifact<"subscription">>(subscription: T, ...[variables, options]: VariablesOf<T> extends undefined ? [undefined?, UseSubscriptionOptions<T>?] : [VariablesOf<T>, UseSubscriptionOptions<T>?]) => Subscription<T>;
57
+ declare const useSubscription: <T extends Artifact<"subscription">>(subscription: T, ...[variables, options]: VariablesOf<T> extends Record<string, never> ? [undefined?, UseSubscriptionOptions<T>?] : [VariablesOf<T>, UseSubscriptionOptions<T>?]) => Subscription<T>;
58
58
  //#endregion
59
59
  //#region src/use-mutation.d.ts
60
60
  type MutationResult<T extends Artifact<'mutation'>> = {
@@ -71,7 +71,7 @@ type MutationResult<T extends Artifact<'mutation'>> = {
71
71
  error: AggregatedError;
72
72
  };
73
73
  type UseMutationOptions = MutationOptions;
74
- type Mutation<T extends Artifact<'mutation'>> = [(...[variables, options]: VariablesOf<T> extends undefined ? [undefined?, UseMutationOptions?] : [VariablesOf<T>, UseMutationOptions?]) => Promise<DataOf<T>>, MutationResult<T>];
74
+ type Mutation<T extends Artifact<'mutation'>> = [(...[variables, options]: VariablesOf<T> extends Record<string, never> ? [undefined?, UseMutationOptions?] : [VariablesOf<T>, UseMutationOptions?]) => Promise<DataOf<T>>, MutationResult<T>];
75
75
  declare const useMutation: <T extends Artifact<"mutation">>(mutation: T) => Mutation<T>;
76
76
  //#endregion
77
77
  //#region src/use-fragment.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mearie/react",
3
- "version": "0.0.1-next.5",
3
+ "version": "0.1.1",
4
4
  "description": "Type-safe, zero-overhead GraphQL client",
5
5
  "keywords": [
6
6
  "graphql",
@@ -40,7 +40,7 @@
40
40
  "README.md"
41
41
  ],
42
42
  "dependencies": {
43
- "@mearie/core": "0.0.1-next.5"
43
+ "@mearie/core": "0.1.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/react": "^19.2.2",