@sumaris-net/ngx-components 18.5.0-alpha3 → 18.5.0-rc1
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/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { Apollo, ExtraSubscriptionOptions, QueryRef } from 'apollo-angular';
|
|
3
|
-
import { ApolloCache, ApolloClient, FetchPolicy,
|
|
3
|
+
import { ApolloCache, ApolloClient, FetchPolicy, MutationUpdaterFunction, OperationVariables, TypePolicies, Unmasked, WatchQueryFetchPolicy } from '@apollo/client/core';
|
|
4
4
|
import { ServiceError } from '../services/errors';
|
|
5
5
|
import { InjectionToken } from '@angular/core';
|
|
6
6
|
import { NetworkService } from '../services/network.service';
|
|
7
7
|
import { EmptyObject } from './graphql.utils';
|
|
8
8
|
import { Platform } from '@ionic/angular';
|
|
9
9
|
import { IEntity } from '../services/model/entity.model';
|
|
10
|
-
import {
|
|
10
|
+
import { Resolvers } from '@apollo/client/core/types';
|
|
11
11
|
import { HttpLink } from 'apollo-angular/http';
|
|
12
12
|
import { ErrorPolicy, MutationBaseOptions } from '@apollo/client/core/watchQueryOptions';
|
|
13
13
|
import { Cache } from '@apollo/client/cache/core/types/Cache';
|
|
@@ -23,18 +23,19 @@ export interface WatchQueryOptions<V> {
|
|
|
23
23
|
error?: ServiceError;
|
|
24
24
|
fetchPolicy?: WatchQueryFetchPolicy;
|
|
25
25
|
}
|
|
26
|
-
export interface
|
|
26
|
+
export interface TrackedMutationContext extends Record<string, any> {
|
|
27
|
+
serializationKey?: string;
|
|
28
|
+
tracked?: boolean;
|
|
29
|
+
timeout?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface MutateQueryOptions<TData, TVariables = OperationVariables, TContext extends TrackedMutationContext = TrackedMutationContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationBaseOptions<TData, TVariables, TContext, TCache> {
|
|
27
32
|
mutation: any;
|
|
28
33
|
variables?: TVariables;
|
|
29
34
|
error?: ServiceError;
|
|
30
|
-
context?:
|
|
31
|
-
serializationKey?: string;
|
|
32
|
-
tracked?: boolean;
|
|
33
|
-
timeout?: number;
|
|
34
|
-
};
|
|
35
|
+
context?: TContext;
|
|
35
36
|
optimisticResponse?: Unmasked<NoInfer<TData>>;
|
|
36
|
-
offlineResponse?: TData | ((context:
|
|
37
|
-
update?:
|
|
37
|
+
offlineResponse?: TData | ((context: TContext) => Promise<TData>);
|
|
38
|
+
update?: MutationUpdaterFunction<TData, TVariables, TContext, TCache>;
|
|
38
39
|
forceOffline?: boolean;
|
|
39
40
|
}
|
|
40
41
|
export declare const APP_GRAPHQL_TYPE_POLICIES: InjectionToken<TypePolicies>;
|