implemented copy paste

This commit is contained in:
2021-08-16 01:42:29 +02:00
parent 4d85a419cc
commit 8344766ae3
4 changed files with 71 additions and 6 deletions

View File

@@ -60,8 +60,8 @@ export type RootMutationDeleteArgs = {
export type RootMutationMoveArgs = {
src: Scalars["ID"];
dest: Scalars["ID"];
src: Scalars["ID"];
};
export type RootQuery = {
@@ -86,6 +86,20 @@ export type RootQueryFilesArgs = {
path: Scalars["String"];
};
export type CopyMutationVariables = Exact<{
src: Scalars["ID"];
dest: Scalars["ID"];
}>;
export type CopyMutation = (
{ __typename?: "RootMutation" }
& { copy?: Maybe<(
{ __typename?: "File" }
& Pick<File, "id">
)> }
);
export type DeleteFileMutationVariables = Exact<{
id: Scalars["ID"];
}>;
@@ -126,6 +140,40 @@ export type OpenDirQuery = (
);
export const CopyDocument = gql`
mutation copy($src: ID!, $dest: ID!) {
copy(src: $src, dest: $dest) {
id
}
}
`
export type CopyMutationFn = Apollo.MutationFunction<CopyMutation, CopyMutationVariables>;
/**
* __useCopyMutation__
*
* To run a mutation, you first call `useCopyMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useCopyMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
* const [copyMutation, { data, loading, error }] = useCopyMutation({
* variables: {
* src: // value for 'src'
* dest: // value for 'dest'
* },
* });
*/
export function useCopyMutation(baseOptions?: Apollo.MutationHookOptions<CopyMutation, CopyMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<CopyMutation, CopyMutationVariables>(CopyDocument, options)
}
export type CopyMutationHookResult = ReturnType<typeof useCopyMutation>;
export type CopyMutationResult = Apollo.MutationResult<CopyMutation>;
export type CopyMutationOptions = Apollo.BaseMutationOptions<CopyMutation, CopyMutationVariables>;
export const DeleteFileDocument = gql`
mutation deleteFile($id: ID!) {
delete(id: $id)