import { gql } from "@apollo/client" import * as Apollo from "@apollo/client" export type Maybe = T | null; export type Exact = { [K in keyof T]: T[K] }; export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; const defaultOptions = {} /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string; String: string; Boolean: boolean; Int: number; Float: number; }; /** Represents a directory */ export type Directory = { __typename?: "Directory"; directorys?: Maybe>>; files?: Maybe>>; id: Scalars["ID"]; name?: Maybe; parent?: Maybe; }; /** Represents a file, not a directory */ export type File = { __typename?: "File"; contentType?: Maybe; etag?: Maybe; /** The uniqe ID of the file. Represents the path and the s3 key. */ id: Scalars["ID"]; name?: Maybe; parent?: Maybe; size: Scalars["Int"]; }; export type RootQuery = { __typename?: "RootQuery"; directorys: Array>; file?: Maybe; files: Array>; }; export type RootQueryDirectorysArgs = { path: Scalars["String"]; }; export type RootQueryFileArgs = { id: Scalars["ID"]; }; export type RootQueryFilesArgs = { path: Scalars["String"]; }; export type GetFileQueryVariables = Exact<{ id: Scalars["ID"]; }>; export type GetFileQuery = ( { __typename?: "RootQuery" } & { file?: Maybe<( { __typename?: "File" } & Pick )> } ); export type OpenDirQueryVariables = Exact<{ path: Scalars["String"]; }>; export type OpenDirQuery = ( { __typename?: "RootQuery" } & { files: Array )>>, directorys: Array )>> } ); 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) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(GetFileDocument, options) } export function useGetFileLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(GetFileDocument, options) } export type GetFileQueryHookResult = ReturnType; export type GetFileLazyQueryHookResult = ReturnType; export type GetFileQueryResult = Apollo.QueryResult; export const OpenDirDocument = gql` query openDir($path: String!) { files(path: $path) { id name size } directorys(path: $path) { id name } } ` /** * __useOpenDirQuery__ * * To run a query within a React component, call `useOpenDirQuery` and pass it any options that fit your needs. * When your component renders, `useOpenDirQuery` 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 } = useOpenDirQuery({ * variables: { * path: // value for 'path' * }, * }); */ export function useOpenDirQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(OpenDirDocument, options) } export function useOpenDirLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(OpenDirDocument, options) } export type OpenDirQueryHookResult = ReturnType; export type OpenDirLazyQueryHookResult = ReturnType; export type OpenDirQueryResult = Apollo.QueryResult;