From 5af4ff23b5240ddb97bc94d1e398a27bdc316d45 Mon Sep 17 00:00:00 2001 From: Ian Krieger Date: Wed, 8 Nov 2023 15:56:50 -0500 Subject: [PATCH] fix: location picker --- src/components/Location/LocationPicker.tsx | 4 +- src/graphql/advertiser.generated.tsx | 60 ++++++++++++++++++++ src/graphql/analytics-overview.generated.tsx | 30 ++++++++++ src/graphql/campaign.generated.tsx | 30 ++++++++++ src/graphql/common.generated.tsx | 30 ++++++++++ src/graphql/creative.generated.tsx | 45 +++++++++++++++ src/graphql/types.ts | 8 +-- src/graphql/url.generated.tsx | 15 +++++ src/graphql/user.generated.tsx | 15 +++++ 9 files changed, 229 insertions(+), 8 deletions(-) diff --git a/src/components/Location/LocationPicker.tsx b/src/components/Location/LocationPicker.tsx index 7062679f..3f437b91 100644 --- a/src/components/Location/LocationPicker.tsx +++ b/src/components/Location/LocationPicker.tsx @@ -11,7 +11,7 @@ const checkedIcon = ; export const LocationPicker = () => { const { data } = useActiveGeocodesQuery(); - const sorted = _.sortBy(data?.activeGeocodes?.data ?? [], "name"); + const sorted = _.sortBy(data?.activeGeocodes?.data ?? [], "code"); const [formProps, meta, helper] = useField("geoTargets"); const errorMessage = meta.error; @@ -25,7 +25,7 @@ export const LocationPicker = () => { options={sorted} disableCloseOnSelect autoHighlight - getOptionLabel={(option) => option.name} + getOptionLabel={(option) => option.name ?? option.code} renderOption={(props, option, { selected }) => (
  • , +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery( + AdvertiserDocument, + options, + ); +} export type AdvertiserQueryHookResult = ReturnType; export type AdvertiserLazyQueryHookResult = ReturnType< typeof useAdvertiserLazyQuery >; +export type AdvertiserSuspenseQueryHookResult = ReturnType< + typeof useAdvertiserSuspenseQuery +>; export type AdvertiserQueryResult = Apollo.QueryResult< AdvertiserQuery, AdvertiserQueryVariables @@ -392,12 +407,27 @@ export function useAdvertiserCampaignsLazyQuery( AdvertiserCampaignsQueryVariables >(AdvertiserCampaignsDocument, options); } +export function useAdvertiserCampaignsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + AdvertiserCampaignsQuery, + AdvertiserCampaignsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + AdvertiserCampaignsQuery, + AdvertiserCampaignsQueryVariables + >(AdvertiserCampaignsDocument, options); +} export type AdvertiserCampaignsQueryHookResult = ReturnType< typeof useAdvertiserCampaignsQuery >; export type AdvertiserCampaignsLazyQueryHookResult = ReturnType< typeof useAdvertiserCampaignsLazyQuery >; +export type AdvertiserCampaignsSuspenseQueryHookResult = ReturnType< + typeof useAdvertiserCampaignsSuspenseQuery +>; export type AdvertiserCampaignsQueryResult = Apollo.QueryResult< AdvertiserCampaignsQuery, AdvertiserCampaignsQueryVariables @@ -458,12 +488,27 @@ export function useAdvertiserImagesLazyQuery( AdvertiserImagesQueryVariables >(AdvertiserImagesDocument, options); } +export function useAdvertiserImagesSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + AdvertiserImagesQuery, + AdvertiserImagesQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + AdvertiserImagesQuery, + AdvertiserImagesQueryVariables + >(AdvertiserImagesDocument, options); +} export type AdvertiserImagesQueryHookResult = ReturnType< typeof useAdvertiserImagesQuery >; export type AdvertiserImagesLazyQueryHookResult = ReturnType< typeof useAdvertiserImagesLazyQuery >; +export type AdvertiserImagesSuspenseQueryHookResult = ReturnType< + typeof useAdvertiserImagesSuspenseQuery +>; export type AdvertiserImagesQueryResult = Apollo.QueryResult< AdvertiserImagesQuery, AdvertiserImagesQueryVariables @@ -524,12 +569,27 @@ export function useAdvertiserPricesLazyQuery( AdvertiserPricesQueryVariables >(AdvertiserPricesDocument, options); } +export function useAdvertiserPricesSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + AdvertiserPricesQuery, + AdvertiserPricesQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + AdvertiserPricesQuery, + AdvertiserPricesQueryVariables + >(AdvertiserPricesDocument, options); +} export type AdvertiserPricesQueryHookResult = ReturnType< typeof useAdvertiserPricesQuery >; export type AdvertiserPricesLazyQueryHookResult = ReturnType< typeof useAdvertiserPricesLazyQuery >; +export type AdvertiserPricesSuspenseQueryHookResult = ReturnType< + typeof useAdvertiserPricesSuspenseQuery +>; export type AdvertiserPricesQueryResult = Apollo.QueryResult< AdvertiserPricesQuery, AdvertiserPricesQueryVariables diff --git a/src/graphql/analytics-overview.generated.tsx b/src/graphql/analytics-overview.generated.tsx index e7a45beb..4e65134a 100644 --- a/src/graphql/analytics-overview.generated.tsx +++ b/src/graphql/analytics-overview.generated.tsx @@ -220,12 +220,27 @@ export function useAnalyticOverviewLazyQuery( AnalyticOverviewQueryVariables >(AnalyticOverviewDocument, options); } +export function useAnalyticOverviewSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + AnalyticOverviewQuery, + AnalyticOverviewQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + AnalyticOverviewQuery, + AnalyticOverviewQueryVariables + >(AnalyticOverviewDocument, options); +} export type AnalyticOverviewQueryHookResult = ReturnType< typeof useAnalyticOverviewQuery >; export type AnalyticOverviewLazyQueryHookResult = ReturnType< typeof useAnalyticOverviewLazyQuery >; +export type AnalyticOverviewSuspenseQueryHookResult = ReturnType< + typeof useAnalyticOverviewSuspenseQuery +>; export type AnalyticOverviewQueryResult = Apollo.QueryResult< AnalyticOverviewQuery, AnalyticOverviewQueryVariables @@ -289,12 +304,27 @@ export function useEngagementOverviewLazyQuery( EngagementOverviewQueryVariables >(EngagementOverviewDocument, options); } +export function useEngagementOverviewSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + EngagementOverviewQuery, + EngagementOverviewQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + EngagementOverviewQuery, + EngagementOverviewQueryVariables + >(EngagementOverviewDocument, options); +} export type EngagementOverviewQueryHookResult = ReturnType< typeof useEngagementOverviewQuery >; export type EngagementOverviewLazyQueryHookResult = ReturnType< typeof useEngagementOverviewLazyQuery >; +export type EngagementOverviewSuspenseQueryHookResult = ReturnType< + typeof useEngagementOverviewSuspenseQuery +>; export type EngagementOverviewQueryResult = Apollo.QueryResult< EngagementOverviewQuery, EngagementOverviewQueryVariables diff --git a/src/graphql/campaign.generated.tsx b/src/graphql/campaign.generated.tsx index b212b0ec..82425b8b 100644 --- a/src/graphql/campaign.generated.tsx +++ b/src/graphql/campaign.generated.tsx @@ -560,12 +560,27 @@ export function useLoadCampaignLazyQuery( options, ); } +export function useLoadCampaignSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + LoadCampaignQuery, + LoadCampaignQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery( + LoadCampaignDocument, + options, + ); +} export type LoadCampaignQueryHookResult = ReturnType< typeof useLoadCampaignQuery >; export type LoadCampaignLazyQueryHookResult = ReturnType< typeof useLoadCampaignLazyQuery >; +export type LoadCampaignSuspenseQueryHookResult = ReturnType< + typeof useLoadCampaignSuspenseQuery +>; export type LoadCampaignQueryResult = Apollo.QueryResult< LoadCampaignQuery, LoadCampaignQueryVariables @@ -624,12 +639,27 @@ export function useLoadCampaignAdsLazyQuery( LoadCampaignAdsQueryVariables >(LoadCampaignAdsDocument, options); } +export function useLoadCampaignAdsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + LoadCampaignAdsQuery, + LoadCampaignAdsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + LoadCampaignAdsQuery, + LoadCampaignAdsQueryVariables + >(LoadCampaignAdsDocument, options); +} export type LoadCampaignAdsQueryHookResult = ReturnType< typeof useLoadCampaignAdsQuery >; export type LoadCampaignAdsLazyQueryHookResult = ReturnType< typeof useLoadCampaignAdsLazyQuery >; +export type LoadCampaignAdsSuspenseQueryHookResult = ReturnType< + typeof useLoadCampaignAdsSuspenseQuery +>; export type LoadCampaignAdsQueryResult = Apollo.QueryResult< LoadCampaignAdsQuery, LoadCampaignAdsQueryVariables diff --git a/src/graphql/common.generated.tsx b/src/graphql/common.generated.tsx index 216734e0..4ad041a7 100644 --- a/src/graphql/common.generated.tsx +++ b/src/graphql/common.generated.tsx @@ -83,12 +83,27 @@ export function useActiveGeocodesLazyQuery( options, ); } +export function useActiveGeocodesSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + ActiveGeocodesQuery, + ActiveGeocodesQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + ActiveGeocodesQuery, + ActiveGeocodesQueryVariables + >(ActiveGeocodesDocument, options); +} export type ActiveGeocodesQueryHookResult = ReturnType< typeof useActiveGeocodesQuery >; export type ActiveGeocodesLazyQueryHookResult = ReturnType< typeof useActiveGeocodesLazyQuery >; +export type ActiveGeocodesSuspenseQueryHookResult = ReturnType< + typeof useActiveGeocodesSuspenseQuery +>; export type ActiveGeocodesQueryResult = Apollo.QueryResult< ActiveGeocodesQuery, ActiveGeocodesQueryVariables @@ -145,10 +160,25 @@ export function useSegmentsLazyQuery( options, ); } +export function useSegmentsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + SegmentsQuery, + SegmentsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery( + SegmentsDocument, + options, + ); +} export type SegmentsQueryHookResult = ReturnType; export type SegmentsLazyQueryHookResult = ReturnType< typeof useSegmentsLazyQuery >; +export type SegmentsSuspenseQueryHookResult = ReturnType< + typeof useSegmentsSuspenseQuery +>; export type SegmentsQueryResult = Apollo.QueryResult< SegmentsQuery, SegmentsQueryVariables diff --git a/src/graphql/creative.generated.tsx b/src/graphql/creative.generated.tsx index 72f8bfb4..101fa7d1 100644 --- a/src/graphql/creative.generated.tsx +++ b/src/graphql/creative.generated.tsx @@ -365,12 +365,27 @@ export function useAdvertiserCreativesLazyQuery( AdvertiserCreativesQueryVariables >(AdvertiserCreativesDocument, options); } +export function useAdvertiserCreativesSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + AdvertiserCreativesQuery, + AdvertiserCreativesQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + AdvertiserCreativesQuery, + AdvertiserCreativesQueryVariables + >(AdvertiserCreativesDocument, options); +} export type AdvertiserCreativesQueryHookResult = ReturnType< typeof useAdvertiserCreativesQuery >; export type AdvertiserCreativesLazyQueryHookResult = ReturnType< typeof useAdvertiserCreativesLazyQuery >; +export type AdvertiserCreativesSuspenseQueryHookResult = ReturnType< + typeof useAdvertiserCreativesSuspenseQuery +>; export type AdvertiserCreativesQueryResult = Apollo.QueryResult< AdvertiserCreativesQuery, AdvertiserCreativesQueryVariables @@ -532,12 +547,27 @@ export function useLoadCreativeLazyQuery( options, ); } +export function useLoadCreativeSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + LoadCreativeQuery, + LoadCreativeQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery( + LoadCreativeDocument, + options, + ); +} export type LoadCreativeQueryHookResult = ReturnType< typeof useLoadCreativeQuery >; export type LoadCreativeLazyQueryHookResult = ReturnType< typeof useLoadCreativeLazyQuery >; +export type LoadCreativeSuspenseQueryHookResult = ReturnType< + typeof useLoadCreativeSuspenseQuery +>; export type LoadCreativeQueryResult = Apollo.QueryResult< LoadCreativeQuery, LoadCreativeQueryVariables @@ -598,12 +628,27 @@ export function useCampaignsForCreativeLazyQuery( CampaignsForCreativeQueryVariables >(CampaignsForCreativeDocument, options); } +export function useCampaignsForCreativeSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + CampaignsForCreativeQuery, + CampaignsForCreativeQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + CampaignsForCreativeQuery, + CampaignsForCreativeQueryVariables + >(CampaignsForCreativeDocument, options); +} export type CampaignsForCreativeQueryHookResult = ReturnType< typeof useCampaignsForCreativeQuery >; export type CampaignsForCreativeLazyQueryHookResult = ReturnType< typeof useCampaignsForCreativeLazyQuery >; +export type CampaignsForCreativeSuspenseQueryHookResult = ReturnType< + typeof useCampaignsForCreativeSuspenseQuery +>; export type CampaignsForCreativeQueryResult = Apollo.QueryResult< CampaignsForCreativeQuery, CampaignsForCreativeQueryVariables diff --git a/src/graphql/types.ts b/src/graphql/types.ts index eb556346..75f12e08 100644 --- a/src/graphql/types.ts +++ b/src/graphql/types.ts @@ -186,8 +186,6 @@ export type CreateAdvertiserInput = { name: Scalars["String"]["input"]; phone?: InputMaybe; referrer?: InputMaybe; - selfServiceCreate?: InputMaybe; - selfServiceEdit?: InputMaybe; selfServiceManageCampaign?: InputMaybe; state?: InputMaybe; url?: InputMaybe; @@ -200,7 +198,7 @@ export type CreateCampaignInput = { brandedKeyword?: InputMaybe; budget: Scalars["Float"]["input"]; currency: Scalars["String"]["input"]; - dailyBudget: Scalars["Float"]["input"]; + dailyBudget?: InputMaybe; dailyCap: Scalars["Float"]["input"]; dayPartings?: InputMaybe>; dayProportion?: InputMaybe; @@ -334,7 +332,7 @@ export type FocalPointInput = { export type GeocodeInput = { code: Scalars["String"]["input"]; - name: Scalars["String"]["input"]; + name?: InputMaybe; }; export type InPagePayloadInput = { @@ -468,8 +466,6 @@ export type UpdateAdvertiserInput = { phone?: InputMaybe; publicKey?: InputMaybe; referrer?: InputMaybe; - selfServiceCreate?: InputMaybe; - selfServiceEdit?: InputMaybe; selfServiceManageCampaign?: InputMaybe; state?: InputMaybe; url?: InputMaybe; diff --git a/src/graphql/url.generated.tsx b/src/graphql/url.generated.tsx index 4ca1df76..7a4592e6 100644 --- a/src/graphql/url.generated.tsx +++ b/src/graphql/url.generated.tsx @@ -72,12 +72,27 @@ export function useValidateTargetUrlLazyQuery( ValidateTargetUrlQueryVariables >(ValidateTargetUrlDocument, options); } +export function useValidateTargetUrlSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + ValidateTargetUrlQuery, + ValidateTargetUrlQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + ValidateTargetUrlQuery, + ValidateTargetUrlQueryVariables + >(ValidateTargetUrlDocument, options); +} export type ValidateTargetUrlQueryHookResult = ReturnType< typeof useValidateTargetUrlQuery >; export type ValidateTargetUrlLazyQueryHookResult = ReturnType< typeof useValidateTargetUrlLazyQuery >; +export type ValidateTargetUrlSuspenseQueryHookResult = ReturnType< + typeof useValidateTargetUrlSuspenseQuery +>; export type ValidateTargetUrlQueryResult = Apollo.QueryResult< ValidateTargetUrlQuery, ValidateTargetUrlQueryVariables diff --git a/src/graphql/user.generated.tsx b/src/graphql/user.generated.tsx index 39cb4e85..352e7d6c 100644 --- a/src/graphql/user.generated.tsx +++ b/src/graphql/user.generated.tsx @@ -80,10 +80,25 @@ export function useLoadUserLazyQuery( options, ); } +export function useLoadUserSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + LoadUserQuery, + LoadUserQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery( + LoadUserDocument, + options, + ); +} export type LoadUserQueryHookResult = ReturnType; export type LoadUserLazyQueryHookResult = ReturnType< typeof useLoadUserLazyQuery >; +export type LoadUserSuspenseQueryHookResult = ReturnType< + typeof useLoadUserSuspenseQuery +>; export type LoadUserQueryResult = Apollo.QueryResult< LoadUserQuery, LoadUserQueryVariables