Add filtering support to aggregate gql

This commit is contained in:
2024-03-09 10:21:43 -07:00
parent 19628736c1
commit fd30ae04bf
3 changed files with 115 additions and 103 deletions

View File

@@ -34,6 +34,11 @@ export type Scalars = {
Decimal: { input: any; output: any };
};
export type AggregateInputGql = {
bucketSets: Array<BucketSetInputGql>;
filterInput?: InputMaybe<FilterInput>;
};
export type AggregateResultGql = {
__typename?: "AggregateResultGQL";
featureBuckets: Array<BucketGql>;
@@ -238,7 +243,7 @@ export type PocketingIntentionFeaturesGql = {
export type Query = {
__typename?: "Query";
getAggregateShots: Array<AggregateResultGql>;
getAggregatedShotMetrics: Array<AggregateResultGql>;
getBucketSet?: Maybe<BucketSetGql>;
getLoggedInUser?: Maybe<UserGql>;
getShots: Array<ShotGql>;
@@ -248,8 +253,8 @@ export type Query = {
getVideoMakePercentageIntervals: Array<MakePercentageIntervalGql>;
};
export type QueryGetAggregateShotsArgs = {
bucketSets: Array<BucketSetInputGql>;
export type QueryGetAggregatedShotMetricsArgs = {
aggregateInput: AggregateInputGql;
};
export type QueryGetBucketSetArgs = {
@@ -424,13 +429,13 @@ export enum WallTypeEnum {
Short = "SHORT",
}
export type GetAggregateShotsQueryVariables = Exact<{
bucketSets: Array<BucketSetInputGql> | BucketSetInputGql;
export type GetAggregatedShotMetricsQueryVariables = Exact<{
aggregateInput: AggregateInputGql;
}>;
export type GetAggregateShotsQuery = {
export type GetAggregatedShotMetricsQuery = {
__typename?: "Query";
getAggregateShots: Array<{
getAggregatedShotMetrics: Array<{
__typename?: "AggregateResultGQL";
featureBuckets: Array<{
__typename?: "BucketGQL";
@@ -594,9 +599,9 @@ export type TerminateUploadStreamMutation = {
terminateUploadStream: boolean;
};
export const GetAggregateShotsDocument = gql`
query GetAggregateShots($bucketSets: [BucketSetInputGQL!]!) {
getAggregateShots(bucketSets: $bucketSets) {
export const GetAggregatedShotMetricsDocument = gql`
query GetAggregatedShotMetrics($aggregateInput: AggregateInputGQL!) {
getAggregatedShotMetrics(aggregateInput: $aggregateInput) {
featureBuckets {
rangeKey
lowerBound
@@ -615,69 +620,69 @@ export const GetAggregateShotsDocument = gql`
`;
/**
* __useGetAggregateShotsQuery__
* __useGetAggregatedShotMetricsQuery__
*
* To run a query within a React component, call `useGetAggregateShotsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetAggregateShotsQuery` returns an object from Apollo Client that contains loading, error, and data properties
* To run a query within a React component, call `useGetAggregatedShotMetricsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetAggregatedShotMetricsQuery` 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 } = useGetAggregateShotsQuery({
* const { data, loading, error } = useGetAggregatedShotMetricsQuery({
* variables: {
* bucketSets: // value for 'bucketSets'
* aggregateInput: // value for 'aggregateInput'
* },
* });
*/
export function useGetAggregateShotsQuery(
export function useGetAggregatedShotMetricsQuery(
baseOptions: Apollo.QueryHookOptions<
GetAggregateShotsQuery,
GetAggregateShotsQueryVariables
GetAggregatedShotMetricsQuery,
GetAggregatedShotMetricsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<
GetAggregateShotsQuery,
GetAggregateShotsQueryVariables
>(GetAggregateShotsDocument, options);
GetAggregatedShotMetricsQuery,
GetAggregatedShotMetricsQueryVariables
>(GetAggregatedShotMetricsDocument, options);
}
export function useGetAggregateShotsLazyQuery(
export function useGetAggregatedShotMetricsLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetAggregateShotsQuery,
GetAggregateShotsQueryVariables
GetAggregatedShotMetricsQuery,
GetAggregatedShotMetricsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetAggregateShotsQuery,
GetAggregateShotsQueryVariables
>(GetAggregateShotsDocument, options);
GetAggregatedShotMetricsQuery,
GetAggregatedShotMetricsQueryVariables
>(GetAggregatedShotMetricsDocument, options);
}
export function useGetAggregateShotsSuspenseQuery(
export function useGetAggregatedShotMetricsSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetAggregateShotsQuery,
GetAggregateShotsQueryVariables
GetAggregatedShotMetricsQuery,
GetAggregatedShotMetricsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetAggregateShotsQuery,
GetAggregateShotsQueryVariables
>(GetAggregateShotsDocument, options);
GetAggregatedShotMetricsQuery,
GetAggregatedShotMetricsQueryVariables
>(GetAggregatedShotMetricsDocument, options);
}
export type GetAggregateShotsQueryHookResult = ReturnType<
typeof useGetAggregateShotsQuery
export type GetAggregatedShotMetricsQueryHookResult = ReturnType<
typeof useGetAggregatedShotMetricsQuery
>;
export type GetAggregateShotsLazyQueryHookResult = ReturnType<
typeof useGetAggregateShotsLazyQuery
export type GetAggregatedShotMetricsLazyQueryHookResult = ReturnType<
typeof useGetAggregatedShotMetricsLazyQuery
>;
export type GetAggregateShotsSuspenseQueryHookResult = ReturnType<
typeof useGetAggregateShotsSuspenseQuery
export type GetAggregatedShotMetricsSuspenseQueryHookResult = ReturnType<
typeof useGetAggregatedShotMetricsSuspenseQuery
>;
export type GetAggregateShotsQueryResult = Apollo.QueryResult<
GetAggregateShotsQuery,
GetAggregateShotsQueryVariables
export type GetAggregatedShotMetricsQueryResult = Apollo.QueryResult<
GetAggregatedShotMetricsQuery,
GetAggregatedShotMetricsQueryVariables
>;
export const GetFeedDocument = gql`
query GetFeed($limit: Int! = 5, $after: String = null) {