@zeroin.earth/appwrite-graphql 0.14.10 → 0.14.11
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.d.mts +59 -35
- package/dist/index.d.ts +59 -35
- package/dist/index.js +22 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -5467,13 +5467,15 @@ declare function useSuspenseCollection<TDocument>({ databaseId, collectionId, qu
|
|
|
5467
5467
|
declare function useCreateDocument(): _tanstack_react_query.UseMutationResult<{
|
|
5468
5468
|
__typename?: "Document";
|
|
5469
5469
|
_id?: string;
|
|
5470
|
-
}, AppwriteException, Exact<{
|
|
5470
|
+
}, AppwriteException, Omit<Exact<{
|
|
5471
5471
|
databaseId: string;
|
|
5472
5472
|
collectionId: string;
|
|
5473
5473
|
documentId: string;
|
|
5474
5474
|
data: any;
|
|
5475
5475
|
permissions?: string | string[];
|
|
5476
|
-
}>,
|
|
5476
|
+
}>, "permissions"> & {
|
|
5477
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5478
|
+
}, unknown>;
|
|
5477
5479
|
|
|
5478
5480
|
declare function useDeleteDocument(): {
|
|
5479
5481
|
data: undefined;
|
|
@@ -5752,131 +5754,153 @@ declare function useUpdateDocument<TDocument>(): {
|
|
|
5752
5754
|
isPending: false;
|
|
5753
5755
|
isSuccess: false;
|
|
5754
5756
|
status: "idle";
|
|
5755
|
-
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5757
|
+
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5756
5758
|
databaseId: string;
|
|
5757
5759
|
collectionId: string;
|
|
5758
5760
|
documentId: string;
|
|
5759
|
-
data
|
|
5761
|
+
data?: any;
|
|
5760
5762
|
permissions?: string | string[];
|
|
5761
|
-
}>,
|
|
5763
|
+
}>, "permissions"> & {
|
|
5764
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5765
|
+
}, unknown>;
|
|
5762
5766
|
reset: () => void;
|
|
5763
5767
|
context: unknown;
|
|
5764
5768
|
failureCount: number;
|
|
5765
5769
|
failureReason: AppwriteException;
|
|
5766
5770
|
isPaused: boolean;
|
|
5767
5771
|
submittedAt: number;
|
|
5768
|
-
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5772
|
+
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5769
5773
|
databaseId: string;
|
|
5770
5774
|
collectionId: string;
|
|
5771
5775
|
documentId: string;
|
|
5772
|
-
data
|
|
5776
|
+
data?: any;
|
|
5773
5777
|
permissions?: string | string[];
|
|
5774
|
-
}>,
|
|
5778
|
+
}>, "permissions"> & {
|
|
5779
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5780
|
+
}, unknown>;
|
|
5775
5781
|
} | {
|
|
5776
5782
|
data: undefined;
|
|
5777
|
-
variables: Exact<{
|
|
5783
|
+
variables: Omit<Exact<{
|
|
5778
5784
|
databaseId: string;
|
|
5779
5785
|
collectionId: string;
|
|
5780
5786
|
documentId: string;
|
|
5781
|
-
data
|
|
5787
|
+
data?: any;
|
|
5782
5788
|
permissions?: string | string[];
|
|
5783
|
-
}
|
|
5789
|
+
}>, "permissions"> & {
|
|
5790
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5791
|
+
};
|
|
5784
5792
|
error: null;
|
|
5785
5793
|
isError: false;
|
|
5786
5794
|
isIdle: false;
|
|
5787
5795
|
isPending: true;
|
|
5788
5796
|
isSuccess: false;
|
|
5789
5797
|
status: "pending";
|
|
5790
|
-
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5798
|
+
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5791
5799
|
databaseId: string;
|
|
5792
5800
|
collectionId: string;
|
|
5793
5801
|
documentId: string;
|
|
5794
|
-
data
|
|
5802
|
+
data?: any;
|
|
5795
5803
|
permissions?: string | string[];
|
|
5796
|
-
}>,
|
|
5804
|
+
}>, "permissions"> & {
|
|
5805
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5806
|
+
}, unknown>;
|
|
5797
5807
|
reset: () => void;
|
|
5798
5808
|
context: unknown;
|
|
5799
5809
|
failureCount: number;
|
|
5800
5810
|
failureReason: AppwriteException;
|
|
5801
5811
|
isPaused: boolean;
|
|
5802
5812
|
submittedAt: number;
|
|
5803
|
-
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5813
|
+
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5804
5814
|
databaseId: string;
|
|
5805
5815
|
collectionId: string;
|
|
5806
5816
|
documentId: string;
|
|
5807
|
-
data
|
|
5817
|
+
data?: any;
|
|
5808
5818
|
permissions?: string | string[];
|
|
5809
|
-
}>,
|
|
5819
|
+
}>, "permissions"> & {
|
|
5820
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5821
|
+
}, unknown>;
|
|
5810
5822
|
} | {
|
|
5811
5823
|
data: undefined;
|
|
5812
5824
|
error: AppwriteException;
|
|
5813
|
-
variables: Exact<{
|
|
5825
|
+
variables: Omit<Exact<{
|
|
5814
5826
|
databaseId: string;
|
|
5815
5827
|
collectionId: string;
|
|
5816
5828
|
documentId: string;
|
|
5817
|
-
data
|
|
5829
|
+
data?: any;
|
|
5818
5830
|
permissions?: string | string[];
|
|
5819
|
-
}
|
|
5831
|
+
}>, "permissions"> & {
|
|
5832
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5833
|
+
};
|
|
5820
5834
|
isError: true;
|
|
5821
5835
|
isIdle: false;
|
|
5822
5836
|
isPending: false;
|
|
5823
5837
|
isSuccess: false;
|
|
5824
5838
|
status: "error";
|
|
5825
|
-
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5839
|
+
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5826
5840
|
databaseId: string;
|
|
5827
5841
|
collectionId: string;
|
|
5828
5842
|
documentId: string;
|
|
5829
|
-
data
|
|
5843
|
+
data?: any;
|
|
5830
5844
|
permissions?: string | string[];
|
|
5831
|
-
}>,
|
|
5845
|
+
}>, "permissions"> & {
|
|
5846
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5847
|
+
}, unknown>;
|
|
5832
5848
|
reset: () => void;
|
|
5833
5849
|
context: unknown;
|
|
5834
5850
|
failureCount: number;
|
|
5835
5851
|
failureReason: AppwriteException;
|
|
5836
5852
|
isPaused: boolean;
|
|
5837
5853
|
submittedAt: number;
|
|
5838
|
-
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5854
|
+
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5839
5855
|
databaseId: string;
|
|
5840
5856
|
collectionId: string;
|
|
5841
5857
|
documentId: string;
|
|
5842
|
-
data
|
|
5858
|
+
data?: any;
|
|
5843
5859
|
permissions?: string | string[];
|
|
5844
|
-
}>,
|
|
5860
|
+
}>, "permissions"> & {
|
|
5861
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5862
|
+
}, unknown>;
|
|
5845
5863
|
} | {
|
|
5846
5864
|
data: Document<TDocument>;
|
|
5847
5865
|
error: null;
|
|
5848
|
-
variables: Exact<{
|
|
5866
|
+
variables: Omit<Exact<{
|
|
5849
5867
|
databaseId: string;
|
|
5850
5868
|
collectionId: string;
|
|
5851
5869
|
documentId: string;
|
|
5852
|
-
data
|
|
5870
|
+
data?: any;
|
|
5853
5871
|
permissions?: string | string[];
|
|
5854
|
-
}
|
|
5872
|
+
}>, "permissions"> & {
|
|
5873
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5874
|
+
};
|
|
5855
5875
|
isError: false;
|
|
5856
5876
|
isIdle: false;
|
|
5857
5877
|
isPending: false;
|
|
5858
5878
|
isSuccess: true;
|
|
5859
5879
|
status: "success";
|
|
5860
|
-
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5880
|
+
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5861
5881
|
databaseId: string;
|
|
5862
5882
|
collectionId: string;
|
|
5863
5883
|
documentId: string;
|
|
5864
|
-
data
|
|
5884
|
+
data?: any;
|
|
5865
5885
|
permissions?: string | string[];
|
|
5866
|
-
}>,
|
|
5886
|
+
}>, "permissions"> & {
|
|
5887
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5888
|
+
}, unknown>;
|
|
5867
5889
|
reset: () => void;
|
|
5868
5890
|
context: unknown;
|
|
5869
5891
|
failureCount: number;
|
|
5870
5892
|
failureReason: AppwriteException;
|
|
5871
5893
|
isPaused: boolean;
|
|
5872
5894
|
submittedAt: number;
|
|
5873
|
-
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5895
|
+
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5874
5896
|
databaseId: string;
|
|
5875
5897
|
collectionId: string;
|
|
5876
5898
|
documentId: string;
|
|
5877
|
-
data
|
|
5899
|
+
data?: any;
|
|
5878
5900
|
permissions?: string | string[];
|
|
5879
|
-
}>,
|
|
5901
|
+
}>, "permissions"> & {
|
|
5902
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5903
|
+
}, unknown>;
|
|
5880
5904
|
};
|
|
5881
5905
|
|
|
5882
5906
|
type Props = {
|
package/dist/index.d.ts
CHANGED
|
@@ -5467,13 +5467,15 @@ declare function useSuspenseCollection<TDocument>({ databaseId, collectionId, qu
|
|
|
5467
5467
|
declare function useCreateDocument(): _tanstack_react_query.UseMutationResult<{
|
|
5468
5468
|
__typename?: "Document";
|
|
5469
5469
|
_id?: string;
|
|
5470
|
-
}, AppwriteException, Exact<{
|
|
5470
|
+
}, AppwriteException, Omit<Exact<{
|
|
5471
5471
|
databaseId: string;
|
|
5472
5472
|
collectionId: string;
|
|
5473
5473
|
documentId: string;
|
|
5474
5474
|
data: any;
|
|
5475
5475
|
permissions?: string | string[];
|
|
5476
|
-
}>,
|
|
5476
|
+
}>, "permissions"> & {
|
|
5477
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5478
|
+
}, unknown>;
|
|
5477
5479
|
|
|
5478
5480
|
declare function useDeleteDocument(): {
|
|
5479
5481
|
data: undefined;
|
|
@@ -5752,131 +5754,153 @@ declare function useUpdateDocument<TDocument>(): {
|
|
|
5752
5754
|
isPending: false;
|
|
5753
5755
|
isSuccess: false;
|
|
5754
5756
|
status: "idle";
|
|
5755
|
-
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5757
|
+
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5756
5758
|
databaseId: string;
|
|
5757
5759
|
collectionId: string;
|
|
5758
5760
|
documentId: string;
|
|
5759
|
-
data
|
|
5761
|
+
data?: any;
|
|
5760
5762
|
permissions?: string | string[];
|
|
5761
|
-
}>,
|
|
5763
|
+
}>, "permissions"> & {
|
|
5764
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5765
|
+
}, unknown>;
|
|
5762
5766
|
reset: () => void;
|
|
5763
5767
|
context: unknown;
|
|
5764
5768
|
failureCount: number;
|
|
5765
5769
|
failureReason: AppwriteException;
|
|
5766
5770
|
isPaused: boolean;
|
|
5767
5771
|
submittedAt: number;
|
|
5768
|
-
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5772
|
+
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5769
5773
|
databaseId: string;
|
|
5770
5774
|
collectionId: string;
|
|
5771
5775
|
documentId: string;
|
|
5772
|
-
data
|
|
5776
|
+
data?: any;
|
|
5773
5777
|
permissions?: string | string[];
|
|
5774
|
-
}>,
|
|
5778
|
+
}>, "permissions"> & {
|
|
5779
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5780
|
+
}, unknown>;
|
|
5775
5781
|
} | {
|
|
5776
5782
|
data: undefined;
|
|
5777
|
-
variables: Exact<{
|
|
5783
|
+
variables: Omit<Exact<{
|
|
5778
5784
|
databaseId: string;
|
|
5779
5785
|
collectionId: string;
|
|
5780
5786
|
documentId: string;
|
|
5781
|
-
data
|
|
5787
|
+
data?: any;
|
|
5782
5788
|
permissions?: string | string[];
|
|
5783
|
-
}
|
|
5789
|
+
}>, "permissions"> & {
|
|
5790
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5791
|
+
};
|
|
5784
5792
|
error: null;
|
|
5785
5793
|
isError: false;
|
|
5786
5794
|
isIdle: false;
|
|
5787
5795
|
isPending: true;
|
|
5788
5796
|
isSuccess: false;
|
|
5789
5797
|
status: "pending";
|
|
5790
|
-
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5798
|
+
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5791
5799
|
databaseId: string;
|
|
5792
5800
|
collectionId: string;
|
|
5793
5801
|
documentId: string;
|
|
5794
|
-
data
|
|
5802
|
+
data?: any;
|
|
5795
5803
|
permissions?: string | string[];
|
|
5796
|
-
}>,
|
|
5804
|
+
}>, "permissions"> & {
|
|
5805
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5806
|
+
}, unknown>;
|
|
5797
5807
|
reset: () => void;
|
|
5798
5808
|
context: unknown;
|
|
5799
5809
|
failureCount: number;
|
|
5800
5810
|
failureReason: AppwriteException;
|
|
5801
5811
|
isPaused: boolean;
|
|
5802
5812
|
submittedAt: number;
|
|
5803
|
-
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5813
|
+
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5804
5814
|
databaseId: string;
|
|
5805
5815
|
collectionId: string;
|
|
5806
5816
|
documentId: string;
|
|
5807
|
-
data
|
|
5817
|
+
data?: any;
|
|
5808
5818
|
permissions?: string | string[];
|
|
5809
|
-
}>,
|
|
5819
|
+
}>, "permissions"> & {
|
|
5820
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5821
|
+
}, unknown>;
|
|
5810
5822
|
} | {
|
|
5811
5823
|
data: undefined;
|
|
5812
5824
|
error: AppwriteException;
|
|
5813
|
-
variables: Exact<{
|
|
5825
|
+
variables: Omit<Exact<{
|
|
5814
5826
|
databaseId: string;
|
|
5815
5827
|
collectionId: string;
|
|
5816
5828
|
documentId: string;
|
|
5817
|
-
data
|
|
5829
|
+
data?: any;
|
|
5818
5830
|
permissions?: string | string[];
|
|
5819
|
-
}
|
|
5831
|
+
}>, "permissions"> & {
|
|
5832
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5833
|
+
};
|
|
5820
5834
|
isError: true;
|
|
5821
5835
|
isIdle: false;
|
|
5822
5836
|
isPending: false;
|
|
5823
5837
|
isSuccess: false;
|
|
5824
5838
|
status: "error";
|
|
5825
|
-
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5839
|
+
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5826
5840
|
databaseId: string;
|
|
5827
5841
|
collectionId: string;
|
|
5828
5842
|
documentId: string;
|
|
5829
|
-
data
|
|
5843
|
+
data?: any;
|
|
5830
5844
|
permissions?: string | string[];
|
|
5831
|
-
}>,
|
|
5845
|
+
}>, "permissions"> & {
|
|
5846
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5847
|
+
}, unknown>;
|
|
5832
5848
|
reset: () => void;
|
|
5833
5849
|
context: unknown;
|
|
5834
5850
|
failureCount: number;
|
|
5835
5851
|
failureReason: AppwriteException;
|
|
5836
5852
|
isPaused: boolean;
|
|
5837
5853
|
submittedAt: number;
|
|
5838
|
-
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5854
|
+
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5839
5855
|
databaseId: string;
|
|
5840
5856
|
collectionId: string;
|
|
5841
5857
|
documentId: string;
|
|
5842
|
-
data
|
|
5858
|
+
data?: any;
|
|
5843
5859
|
permissions?: string | string[];
|
|
5844
|
-
}>,
|
|
5860
|
+
}>, "permissions"> & {
|
|
5861
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5862
|
+
}, unknown>;
|
|
5845
5863
|
} | {
|
|
5846
5864
|
data: Document<TDocument>;
|
|
5847
5865
|
error: null;
|
|
5848
|
-
variables: Exact<{
|
|
5866
|
+
variables: Omit<Exact<{
|
|
5849
5867
|
databaseId: string;
|
|
5850
5868
|
collectionId: string;
|
|
5851
5869
|
documentId: string;
|
|
5852
|
-
data
|
|
5870
|
+
data?: any;
|
|
5853
5871
|
permissions?: string | string[];
|
|
5854
|
-
}
|
|
5872
|
+
}>, "permissions"> & {
|
|
5873
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5874
|
+
};
|
|
5855
5875
|
isError: false;
|
|
5856
5876
|
isIdle: false;
|
|
5857
5877
|
isPending: false;
|
|
5858
5878
|
isSuccess: true;
|
|
5859
5879
|
status: "success";
|
|
5860
|
-
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5880
|
+
mutate: _tanstack_react_query.UseMutateFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5861
5881
|
databaseId: string;
|
|
5862
5882
|
collectionId: string;
|
|
5863
5883
|
documentId: string;
|
|
5864
|
-
data
|
|
5884
|
+
data?: any;
|
|
5865
5885
|
permissions?: string | string[];
|
|
5866
|
-
}>,
|
|
5886
|
+
}>, "permissions"> & {
|
|
5887
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5888
|
+
}, unknown>;
|
|
5867
5889
|
reset: () => void;
|
|
5868
5890
|
context: unknown;
|
|
5869
5891
|
failureCount: number;
|
|
5870
5892
|
failureReason: AppwriteException;
|
|
5871
5893
|
isPaused: boolean;
|
|
5872
5894
|
submittedAt: number;
|
|
5873
|
-
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Exact<{
|
|
5895
|
+
mutateAsync: _tanstack_react_query.UseMutateAsyncFunction<Document<TDocument>, AppwriteException, Omit<Exact<{
|
|
5874
5896
|
databaseId: string;
|
|
5875
5897
|
collectionId: string;
|
|
5876
5898
|
documentId: string;
|
|
5877
|
-
data
|
|
5899
|
+
data?: any;
|
|
5878
5900
|
permissions?: string | string[];
|
|
5879
|
-
}>,
|
|
5901
|
+
}>, "permissions"> & {
|
|
5902
|
+
permissions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5903
|
+
}, unknown>;
|
|
5880
5904
|
};
|
|
5881
5905
|
|
|
5882
5906
|
type Props = {
|
package/dist/index.js
CHANGED
|
@@ -216,7 +216,7 @@ var ListDocumentsDocument = { "kind": "Document", "definitions": [{ "kind": "Ope
|
|
|
216
216
|
var CreateDocumentDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateDocument" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "databaseId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "collectionId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "documentId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "data" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "permissions" } }, "type": { "kind": "ListType", "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "databasesCreateDocument" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "databaseId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "databaseId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "collectionId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "collectionId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "documentId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "documentId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "data" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "data" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "permissions" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "permissions" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "_id" } }] } }] } }] };
|
|
217
217
|
var DeleteDocumentDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "DeleteDocument" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "databaseId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "collectionId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "documentId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "databasesDeleteDocument" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "databaseId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "databaseId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "collectionId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "collectionId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "documentId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "documentId" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "status" } }] } }] } }] };
|
|
218
218
|
var GetDocumentDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetDocument" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "databaseId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "collectionId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "documentId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "databasesGetDocument" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "databaseId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "databaseId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "collectionId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "collectionId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "documentId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "documentId" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "_id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "data" } }] } }] } }] };
|
|
219
|
-
var UpdateDocumentDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "UpdateDocument" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "databaseId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "collectionId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "documentId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "data" } }, "type": { "kind": "
|
|
219
|
+
var UpdateDocumentDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "UpdateDocument" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "databaseId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "collectionId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "documentId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "data" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "JSON" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "permissions" } }, "type": { "kind": "ListType", "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "databasesUpdateDocument" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "databaseId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "databaseId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "collectionId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "collectionId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "documentId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "documentId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "data" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "data" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "permissions" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "permissions" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "_id" } }] } }] } }] };
|
|
220
220
|
var CreateExecutionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateExecution" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "functionId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "body" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "async" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Boolean" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "path" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "method" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "functionsCreateExecution" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "functionId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "functionId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "body" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "body" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "async" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "async" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "path" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "path" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "method" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "method" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "_id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "responseStatusCode" } }, { "kind": "Field", "name": { "kind": "Name", "value": "responseBody" } }, { "kind": "Field", "name": { "kind": "Name", "value": "errors" } }, { "kind": "Field", "name": { "kind": "Name", "value": "duration" } }] } }] } }] };
|
|
221
221
|
var GetFunctionExecutionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetFunctionExecution" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "functionId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "executionId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "functionsGetExecution" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "functionId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "functionId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "executionId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "executionId" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "errors" } }, { "kind": "Field", "name": { "kind": "Name", "value": "duration" } }] } }] } }] };
|
|
222
222
|
|
|
@@ -268,7 +268,7 @@ var documents = {
|
|
|
268
268
|
"\n mutation CreateDocument(\n $databaseId: String!\n $collectionId: String!\n $documentId: String!\n $data: JSON!\n $permissions: [String!]\n ) {\n databasesCreateDocument(\n databaseId: $databaseId\n collectionId: $collectionId\n documentId: $documentId\n data: $data\n permissions: $permissions\n ) {\n _id\n }\n }\n": CreateDocumentDocument,
|
|
269
269
|
"\n mutation DeleteDocument($databaseId: String!, $collectionId: String!, $documentId: String!) {\n databasesDeleteDocument(\n databaseId: $databaseId\n collectionId: $collectionId\n documentId: $documentId\n ) {\n status\n }\n }\n": DeleteDocumentDocument,
|
|
270
270
|
"\n query GetDocument($databaseId: String!, $collectionId: String!, $documentId: String!) {\n databasesGetDocument(\n databaseId: $databaseId\n collectionId: $collectionId\n documentId: $documentId\n ) {\n _id\n data\n }\n }\n": GetDocumentDocument,
|
|
271
|
-
"\n mutation UpdateDocument(\n $databaseId: String!\n $collectionId: String!\n $documentId: String!\n $data: JSON
|
|
271
|
+
"\n mutation UpdateDocument(\n $databaseId: String!\n $collectionId: String!\n $documentId: String!\n $data: JSON\n $permissions: [String!]\n ) {\n databasesUpdateDocument(\n databaseId: $databaseId\n collectionId: $collectionId\n documentId: $documentId\n data: $data\n permissions: $permissions\n ) {\n _id\n }\n }\n": UpdateDocumentDocument,
|
|
272
272
|
"\n mutation CreateExecution(\n $functionId: String!\n $body: String\n $async: Boolean\n $path: String\n $method: String # $headers: JSON\n ) {\n functionsCreateExecution(\n functionId: $functionId\n body: $body\n async: $async\n path: $path\n method: $method # headers: $headers\n ) {\n _id\n status\n responseStatusCode\n responseBody\n errors\n duration\n }\n }\n": CreateExecutionDocument,
|
|
273
273
|
"\n query GetFunctionExecution($functionId: String!, $executionId: String!) {\n functionsGetExecution(functionId: $functionId, executionId: $executionId) {\n status\n errors\n duration\n }\n }\n": GetFunctionExecutionDocument
|
|
274
274
|
};
|
|
@@ -1600,7 +1600,7 @@ function useUpdatePrefs() {
|
|
|
1600
1600
|
const { data, errors } = await graphql2.mutation({
|
|
1601
1601
|
query: accountUpdatePrefs,
|
|
1602
1602
|
variables: {
|
|
1603
|
-
prefs
|
|
1603
|
+
prefs: JSON.stringify(prefs)
|
|
1604
1604
|
}
|
|
1605
1605
|
});
|
|
1606
1606
|
if (errors) {
|
|
@@ -1851,23 +1851,20 @@ var createDocument = gql(
|
|
|
1851
1851
|
`
|
|
1852
1852
|
);
|
|
1853
1853
|
function useCreateDocument() {
|
|
1854
|
-
const {
|
|
1854
|
+
const { databases: databases2 } = useAppwrite();
|
|
1855
1855
|
const mutationResult = useMutation({
|
|
1856
1856
|
mutationFn: async ({ databaseId, collectionId, documentId, data, permissions }) => {
|
|
1857
|
-
const { data: mutationData, errors } = await
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
permissions
|
|
1865
|
-
}
|
|
1866
|
-
});
|
|
1857
|
+
const { data: mutationData, errors } = await databases2.createDocument(
|
|
1858
|
+
databaseId,
|
|
1859
|
+
collectionId,
|
|
1860
|
+
documentId,
|
|
1861
|
+
data,
|
|
1862
|
+
permissions
|
|
1863
|
+
);
|
|
1867
1864
|
if (errors) {
|
|
1868
1865
|
throw errors;
|
|
1869
1866
|
}
|
|
1870
|
-
return mutationData
|
|
1867
|
+
return mutationData;
|
|
1871
1868
|
}
|
|
1872
1869
|
});
|
|
1873
1870
|
return mutationResult;
|
|
@@ -2001,7 +1998,7 @@ var updateDocument = gql(
|
|
|
2001
1998
|
$databaseId: String!
|
|
2002
1999
|
$collectionId: String!
|
|
2003
2000
|
$documentId: String!
|
|
2004
|
-
$data: JSON
|
|
2001
|
+
$data: JSON
|
|
2005
2002
|
$permissions: [String!]
|
|
2006
2003
|
) {
|
|
2007
2004
|
databasesUpdateDocument(
|
|
@@ -2012,37 +2009,25 @@ var updateDocument = gql(
|
|
|
2012
2009
|
permissions: $permissions
|
|
2013
2010
|
) {
|
|
2014
2011
|
_id
|
|
2015
|
-
_collectionId
|
|
2016
|
-
_databaseId
|
|
2017
|
-
_createdAt
|
|
2018
|
-
_updatedAt
|
|
2019
|
-
_permissions
|
|
2020
|
-
data
|
|
2021
2012
|
}
|
|
2022
2013
|
}
|
|
2023
2014
|
`
|
|
2024
2015
|
);
|
|
2025
2016
|
function useUpdateDocument() {
|
|
2026
|
-
const {
|
|
2017
|
+
const { databases: databases2 } = useAppwrite();
|
|
2027
2018
|
const mutationResult = useMutation({
|
|
2028
2019
|
mutationFn: async ({ databaseId, collectionId, documentId, data, permissions }) => {
|
|
2029
|
-
const { data: mutationData, errors } = await
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
permissions
|
|
2037
|
-
}
|
|
2038
|
-
});
|
|
2020
|
+
const { data: mutationData, errors } = await databases2.updateDocument(
|
|
2021
|
+
databaseId,
|
|
2022
|
+
collectionId,
|
|
2023
|
+
documentId,
|
|
2024
|
+
data,
|
|
2025
|
+
permissions
|
|
2026
|
+
);
|
|
2039
2027
|
if (errors) {
|
|
2040
2028
|
throw errors;
|
|
2041
2029
|
}
|
|
2042
|
-
const document =
|
|
2043
|
-
...mutationData.databasesUpdateDocument,
|
|
2044
|
-
...mutationData.databasesUpdateDocument ? JSON.parse(mutationData.databasesUpdateDocument.data) : {}
|
|
2045
|
-
};
|
|
2030
|
+
const document = mutationData;
|
|
2046
2031
|
return document;
|
|
2047
2032
|
}
|
|
2048
2033
|
});
|