refactor: update rest-gql import-export sync

This commit is contained in:
nivedin
2023-12-13 16:11:22 +05:30
committed by Andrew Bastin
parent 8bb628354e
commit e4eaa2cec9
10 changed files with 159 additions and 23 deletions

View File

@@ -70,22 +70,24 @@ import {
UpdateUserCollectionDocument,
} from "../../api/generated/graphql"
export const createRESTRootUserCollection = (title: string) =>
export const createRESTRootUserCollection = (title: string, data?: string) =>
runMutation<
CreateRestRootUserCollectionMutation,
CreateRestRootUserCollectionMutationVariables,
""
>(CreateRestRootUserCollectionDocument, {
title,
data,
})()
export const createGQLRootUserCollection = (title: string) =>
export const createGQLRootUserCollection = (title: string, data?: string) =>
runMutation<
CreateGqlRootUserCollectionMutation,
CreateGqlRootUserCollectionMutationVariables,
""
>(CreateGqlRootUserCollectionDocument, {
title,
data,
})()
export const createRESTUserRequest = (
@@ -120,7 +122,8 @@ export const createGQLUserRequest = (
export const createRESTChildUserCollection = (
title: string,
parentUserCollectionID: string
parentUserCollectionID: string,
data?: string
) =>
runMutation<
CreateRestChildUserCollectionMutation,
@@ -129,11 +132,13 @@ export const createRESTChildUserCollection = (
>(CreateRestChildUserCollectionDocument, {
title,
parentUserCollectionID,
data,
})()
export const createGQLChildUserCollection = (
title: string,
parentUserCollectionID: string
parentUserCollectionID: string,
data?: string
) =>
runMutation<
CreateGqlChildUserCollectionMutation,
@@ -142,6 +147,7 @@ export const createGQLChildUserCollection = (
>(CreateGqlChildUserCollectionDocument, {
title,
parentUserCollectionID,
data,
})()
export const deleteUserCollection = (userCollectionID: string) =>