basic file opening

This commit is contained in:
2021-07-28 12:49:35 +02:00
parent b08a527199
commit 67cbf7ab28
10 changed files with 196 additions and 3 deletions

View File

@@ -58,6 +58,19 @@ export type RootQueryFilesArgs = {
path: Scalars["String"];
};
export type GetFileQueryVariables = Exact<{
id: Scalars["ID"];
}>;
export type GetFileQuery = (
{ __typename?: "RootQuery" }
& { file?: Maybe<(
{ __typename?: "File" }
& Pick<File, "id" | "name" | "size" | "contentType" | "etag">
)> }
);
export type OpenDirQueryVariables = Exact<{
path: Scalars["String"];
}>;
@@ -75,6 +88,45 @@ export type OpenDirQuery = (
);
export const GetFileDocument = gql`
query getFile($id: ID!) {
file(id: $id) {
id
name
size
contentType
etag
}
}
`
/**
* __useGetFileQuery__
*
* To run a query within a React component, call `useGetFileQuery` and pass it any options that fit your needs.
* When your component renders, `useGetFileQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGetFileQuery({
* variables: {
* id: // value for 'id'
* },
* });
*/
export function useGetFileQuery(baseOptions: Apollo.QueryHookOptions<GetFileQuery, GetFileQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetFileQuery, GetFileQueryVariables>(GetFileDocument, options)
}
export function useGetFileLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetFileQuery, GetFileQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetFileQuery, GetFileQueryVariables>(GetFileDocument, options)
}
export type GetFileQueryHookResult = ReturnType<typeof useGetFileQuery>;
export type GetFileLazyQueryHookResult = ReturnType<typeof useGetFileLazyQuery>;
export type GetFileQueryResult = Apollo.QueryResult<GetFileQuery, GetFileQueryVariables>;
export const OpenDirDocument = gql`
query openDir($path: String!) {
files(path: $path) {