Merge pull request 'Add getShotsWithJustIds' (#117) from loewy/update-get-shots-with-video-ids into master

Reviewed-on: #117
This commit is contained in:
loewy 2024-11-06 16:32:59 -07:00
commit c0a3aa97dc
2 changed files with 118 additions and 0 deletions

View File

@ -2973,6 +2973,20 @@ export type GetShotsWithVideoGqlQuery = {
};
};
export type GetShotsWithJustIdsQueryVariables = Exact<{
filterInput: FilterInput;
shotsOrdering?: InputMaybe<GetShotsOrdering>;
limit?: InputMaybe<Scalars["Int"]["input"]>;
}>;
export type GetShotsWithJustIdsQuery = {
__typename?: "Query";
getOrderedShots: {
__typename?: "GetShotsResult";
shots: Array<{ __typename?: "ShotGQL"; id: number; videoId: number }>;
};
};
export type GetShotsWithMetadataFilterResultQueryVariables = Exact<{
filterInput: FilterInput;
shotsOrdering?: InputMaybe<GetShotsOrdering>;
@ -4881,6 +4895,92 @@ export type GetShotsWithVideoGqlQueryResult = Apollo.QueryResult<
GetShotsWithVideoGqlQuery,
GetShotsWithVideoGqlQueryVariables
>;
export const GetShotsWithJustIdsDocument = gql`
query GetShotsWithJustIds(
$filterInput: FilterInput!
$shotsOrdering: GetShotsOrdering
$limit: Int
) {
getOrderedShots(
filterInput: $filterInput
shotsOrdering: $shotsOrdering
limit: $limit
) {
shots {
id
videoId
}
}
}
`;
/**
* __useGetShotsWithJustIdsQuery__
*
* To run a query within a React component, call `useGetShotsWithJustIdsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetShotsWithJustIdsQuery` 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 } = useGetShotsWithJustIdsQuery({
* variables: {
* filterInput: // value for 'filterInput'
* shotsOrdering: // value for 'shotsOrdering'
* limit: // value for 'limit'
* },
* });
*/
export function useGetShotsWithJustIdsQuery(
baseOptions: Apollo.QueryHookOptions<
GetShotsWithJustIdsQuery,
GetShotsWithJustIdsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<
GetShotsWithJustIdsQuery,
GetShotsWithJustIdsQueryVariables
>(GetShotsWithJustIdsDocument, options);
}
export function useGetShotsWithJustIdsLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetShotsWithJustIdsQuery,
GetShotsWithJustIdsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetShotsWithJustIdsQuery,
GetShotsWithJustIdsQueryVariables
>(GetShotsWithJustIdsDocument, options);
}
export function useGetShotsWithJustIdsSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetShotsWithJustIdsQuery,
GetShotsWithJustIdsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetShotsWithJustIdsQuery,
GetShotsWithJustIdsQueryVariables
>(GetShotsWithJustIdsDocument, options);
}
export type GetShotsWithJustIdsQueryHookResult = ReturnType<
typeof useGetShotsWithJustIdsQuery
>;
export type GetShotsWithJustIdsLazyQueryHookResult = ReturnType<
typeof useGetShotsWithJustIdsLazyQuery
>;
export type GetShotsWithJustIdsSuspenseQueryHookResult = ReturnType<
typeof useGetShotsWithJustIdsSuspenseQuery
>;
export type GetShotsWithJustIdsQueryResult = Apollo.QueryResult<
GetShotsWithJustIdsQuery,
GetShotsWithJustIdsQueryVariables
>;
export const GetShotsWithMetadataFilterResultDocument = gql`
query GetShotsWithMetadataFilterResult(
$filterInput: FilterInput!

View File

@ -40,6 +40,7 @@ mutation UpdateShotAnnotations(
}
}
## Should be deprecated
query GetShotsWithVideoGql(
$filterInput: FilterInput!
$shotsOrdering: GetShotsOrdering
@ -61,6 +62,23 @@ query GetShotsWithVideoGql(
}
}
query GetShotsWithJustIds(
$filterInput: FilterInput!
$shotsOrdering: GetShotsOrdering
$limit: Int
) {
getOrderedShots(
filterInput: $filterInput
shotsOrdering: $shotsOrdering
limit: $limit
) {
shots {
id
videoId
}
}
}
## Reserved for playlists (which are created from a filter)
query GetShotsWithMetadataFilterResult(
$filterInput: FilterInput!