diff --git a/apps/wish-wash/web/src/components/items/ItemEditDialog.tsx b/apps/wish-wash/web/src/components/items/ItemEditDialog.tsx index 234e3c3a..847f982a 100644 --- a/apps/wish-wash/web/src/components/items/ItemEditDialog.tsx +++ b/apps/wish-wash/web/src/components/items/ItemEditDialog.tsx @@ -20,11 +20,17 @@ import { preventDefault } from '@a-type/utils'; import { ImageUploader } from '@a-type/ui/components/imageUploader'; import { ItemExpirationEditor } from './ItemExpirationEditor.jsx'; import { NumberStepper } from '@a-type/ui/components/numberStepper'; -import { ReactNode } from 'react'; +import { ReactNode, useCallback } from 'react'; import { Icon } from '@a-type/ui/components/icon'; import { clsx } from '@a-type/ui'; import { withClassName } from '@a-type/ui/hooks'; import { ScrollArea } from '@a-type/ui/components/scrollArea/ScrollArea'; +import { + graphql, + useCanSync, + useLazyQuery, + useMutation, +} from '@biscuits/client'; export interface ItemEditDialogProps { list: List; @@ -222,9 +228,45 @@ function CountField({ item }: { item: Item }) { ); } +const scanPage = graphql(` + query ScanStorePage($url: String!) { + storePageScan(input: { url: $url }) { + currency + price + productName + scanner + } + } +`); + function SingleLinkField({ item }: { item: Item }) { const { links } = hooks.useWatch(item); hooks.useWatch(links); + const firstLink = links.get(0) ?? null; + + const subscribed = useCanSync(); + const [doScan, { loading: scanning }] = useLazyQuery(scanPage); + const maybeScanPage = useCallback(async () => { + // don't scan if data already exists + if (item.get('description')) { + return; + } + + const result = await doScan({ + variables: { + url: firstLink, + }, + }); + if (result.data?.storePageScan) { + const scan = result.data.storePageScan; + console.log('scan result', scan); + item.update({ + description: scan.productName ?? undefined, + }); + } else { + console.error('scan failed', result.error); + } + }, [firstLink, item]); return ( <> @@ -234,8 +276,12 @@ function SingleLinkField({ item }: { item: Item }) { value={links.get(0) || ''} type="url" onChange={(e) => links.set(0, e.currentTarget.value)} + onBlur={maybeScanPage} autoSelect /> + {scanning && ( + Scanning page... + )} ); } diff --git a/package.json b/package.json index b4d9c98f..c4cf7f23 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "kill-port": "2.0.1", "prettier": "3.2.5", "turbo": "^1.9.3", - "typescript": "^5.4.5" + "typescript": "^5.4.5", + "gql.tada": "1.8.5" } } diff --git a/packages/client/src/graphql-env.d.ts b/packages/client/src/graphql-env.d.ts index 837c01a3..1f42ee37 100644 --- a/packages/client/src/graphql-env.d.ts +++ b/packages/client/src/graphql-env.d.ts @@ -40,7 +40,7 @@ export type introspection = { 'JSON': unknown; 'KickMemberResult': { kind: 'OBJECT'; name: 'KickMemberResult'; fields: { 'plan': { name: 'plan'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Plan'; ofType: null; }; } }; }; }; 'LocationAutocompleteSuggestion': { kind: 'OBJECT'; name: 'LocationAutocompleteSuggestion'; fields: { 'placeId': { name: 'placeId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'text': { name: 'text'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; - 'Mutation': { kind: 'OBJECT'; name: 'Mutation'; fields: { 'acceptTermsOfService': { name: 'acceptTermsOfService'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'User'; ofType: null; }; } }; 'addFoodName': { name: 'addFoodName'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'assignFoodCategory': { name: 'assignFoodCategory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssignFoodCategoryResult'; ofType: null; }; } }; 'cancelPlan': { name: 'cancelPlan'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CancelPlanResult'; ofType: null; }; } }; 'cancelPlanInvitation': { name: 'cancelPlanInvitation'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CancelPlanInvitationResult'; ofType: null; }; } }; 'changeFoodCanonicalName': { name: 'changeFoodCanonicalName'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Food'; ofType: null; }; } }; 'claimPlanInvitation': { name: 'claimPlanInvitation'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ClaimPlanInvitationResult'; ofType: null; }; } }; 'createCategory': { name: 'createCategory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CreateCategoryResult'; ofType: null; }; } }; 'createChangelogItem': { name: 'createChangelogItem'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ChangelogItem'; ofType: null; }; } }; 'createPlanInvitation': { name: 'createPlanInvitation'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CreatePlanInvitationResult'; ofType: null; }; } }; 'createPushSubscription': { name: 'createPushSubscription'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'deleteCategory': { name: 'deleteCategory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'DeleteCategoryResult'; ofType: null; }; } }; 'deleteChangelogItem': { name: 'deleteChangelogItem'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ChangelogItem'; ofType: null; }; } }; 'deletePlan': { name: 'deletePlan'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Plan'; ofType: null; }; } }; 'deletePushSubscription': { name: 'deletePushSubscription'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'kickMember': { name: 'kickMember'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'KickMemberResult'; ofType: null; }; } }; 'overrideFoodCategory': { name: 'overrideFoodCategory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssignFoodCategoryResult'; ofType: null; }; } }; 'publishRecipe': { name: 'publishRecipe'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PublishedRecipe'; ofType: null; }; } }; 'removeFoodName': { name: 'removeFoodName'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Food'; ofType: null; }; } }; 'resetSync': { name: 'resetSync'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ResetSyncResult'; ofType: null; }; } }; 'setFeatureFlag': { name: 'setFeatureFlag'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Plan'; ofType: null; }; } }; 'setSendEmailUpdates': { name: 'setSendEmailUpdates'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'User'; ofType: null; }; } }; 'setUserPreference': { name: 'setUserPreference'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SetUserPreferenceResult'; ofType: null; }; } }; 'setUserRole': { name: 'setUserRole'; type: { kind: 'INTERFACE'; name: 'Node'; ofType: null; } }; 'setupPlan': { name: 'setupPlan'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SetupPlanResult'; ofType: null; }; } }; 'unpublishRecipe': { name: 'unpublishRecipe'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'updateCategory': { name: 'updateCategory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UpdateCategoryResult'; ofType: null; }; } }; }; }; + 'Mutation': { kind: 'OBJECT'; name: 'Mutation'; fields: { 'acceptTermsOfService': { name: 'acceptTermsOfService'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'User'; ofType: null; }; } }; 'addFoodName': { name: 'addFoodName'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'assignFoodCategory': { name: 'assignFoodCategory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssignFoodCategoryResult'; ofType: null; }; } }; 'cancelPlan': { name: 'cancelPlan'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CancelPlanResult'; ofType: null; }; } }; 'cancelPlanInvitation': { name: 'cancelPlanInvitation'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CancelPlanInvitationResult'; ofType: null; }; } }; 'changeFoodCanonicalName': { name: 'changeFoodCanonicalName'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Food'; ofType: null; }; } }; 'claimPlanInvitation': { name: 'claimPlanInvitation'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ClaimPlanInvitationResult'; ofType: null; }; } }; 'createCategory': { name: 'createCategory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CreateCategoryResult'; ofType: null; }; } }; 'createChangelogItem': { name: 'createChangelogItem'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ChangelogItem'; ofType: null; }; } }; 'createPlanInvitation': { name: 'createPlanInvitation'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'CreatePlanInvitationResult'; ofType: null; }; } }; 'createPushSubscription': { name: 'createPushSubscription'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'deleteCategory': { name: 'deleteCategory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'DeleteCategoryResult'; ofType: null; }; } }; 'deleteChangelogItem': { name: 'deleteChangelogItem'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ChangelogItem'; ofType: null; }; } }; 'deletePlan': { name: 'deletePlan'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Plan'; ofType: null; }; } }; 'deletePushSubscription': { name: 'deletePushSubscription'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'kickMember': { name: 'kickMember'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'KickMemberResult'; ofType: null; }; } }; 'overrideFoodCategory': { name: 'overrideFoodCategory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssignFoodCategoryResult'; ofType: null; }; } }; 'publishRecipe': { name: 'publishRecipe'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PublishedRecipe'; ofType: null; }; } }; 'publishWishlist': { name: 'publishWishlist'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PublishedWishlist'; ofType: null; }; } }; 'removeFoodName': { name: 'removeFoodName'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Food'; ofType: null; }; } }; 'resetSync': { name: 'resetSync'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ResetSyncResult'; ofType: null; }; } }; 'setFeatureFlag': { name: 'setFeatureFlag'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Plan'; ofType: null; }; } }; 'setSendEmailUpdates': { name: 'setSendEmailUpdates'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'User'; ofType: null; }; } }; 'setUserPreference': { name: 'setUserPreference'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SetUserPreferenceResult'; ofType: null; }; } }; 'setUserRole': { name: 'setUserRole'; type: { kind: 'INTERFACE'; name: 'Node'; ofType: null; } }; 'setupPlan': { name: 'setupPlan'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SetupPlanResult'; ofType: null; }; } }; 'unpublishRecipe': { name: 'unpublishRecipe'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'unpublishWishlist': { name: 'unpublishWishlist'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'updateCategory': { name: 'updateCategory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UpdateCategoryResult'; ofType: null; }; } }; }; }; 'Node': { kind: 'INTERFACE'; name: 'Node'; fields: { 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; }; possibleTypes: 'Food' | 'FoodCategory' | 'Plan' | 'PlanInvitation' | 'User'; }; 'PageInfo': { kind: 'OBJECT'; name: 'PageInfo'; fields: { 'endCursor': { name: 'endCursor'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'hasNextPage': { name: 'hasNextPage'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'hasPreviousPage': { name: 'hasPreviousPage'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'startCursor': { name: 'startCursor'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; 'Plan': { kind: 'OBJECT'; name: 'Plan'; fields: { 'canInviteMore': { name: 'canInviteMore'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'canSync': { name: 'canSync'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'checkoutData': { name: 'checkoutData'; type: { kind: 'OBJECT'; name: 'StripeCheckoutData'; ofType: null; } }; 'featureFlags': { name: 'featureFlags'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'isSubscribed': { name: 'isSubscribed'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'libraryInfo': { name: 'libraryInfo'; type: { kind: 'OBJECT'; name: 'PlanLibraryInfo'; ofType: null; } }; 'members': { name: 'members'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'User'; ofType: null; }; }; }; } }; 'pendingInvitations': { name: 'pendingInvitations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PlanInvitation'; ofType: null; }; }; }; } }; 'productInfo': { name: 'productInfo'; type: { kind: 'OBJECT'; name: 'ProductInfo'; ofType: null; } }; 'subscriptionCanceledAt': { name: 'subscriptionCanceledAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'subscriptionExpiresAt': { name: 'subscriptionExpiresAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'subscriptionStatus': { name: 'subscriptionStatus'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; @@ -50,8 +50,10 @@ export type introspection = { 'PlanLibraryReplicaProfile': { kind: 'OBJECT'; name: 'PlanLibraryReplicaProfile'; fields: { 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'imageUrl': { name: 'imageUrl'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; 'ProductInfo': { kind: 'OBJECT'; name: 'ProductInfo'; fields: { 'currency': { name: 'currency'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'description': { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'price': { name: 'price'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; }; }; 'PublishRecipeInput': { kind: 'INPUT_OBJECT'; name: 'PublishRecipeInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'slug'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; + 'PublishWishlistInput': { kind: 'INPUT_OBJECT'; name: 'PublishWishlistInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'PublishedRecipe': { kind: 'OBJECT'; name: 'PublishedRecipe'; fields: { 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'publishedAt': { name: 'publishedAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'url': { name: 'url'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; - 'Query': { kind: 'OBJECT'; name: 'Query'; fields: { 'changelog': { name: 'changelog'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ChangelogItem'; ofType: null; }; }; }; } }; 'food': { name: 'food'; type: { kind: 'OBJECT'; name: 'Food'; ofType: null; } }; 'foodCategories': { name: 'foodCategories'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'FoodCategory'; ofType: null; }; }; }; } }; 'foods': { name: 'foods'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'QueryFoodsConnection'; ofType: null; }; } }; 'geographicLocation': { name: 'geographicLocation'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GeographicResult'; ofType: null; }; } }; 'locationAutocomplete': { name: 'locationAutocomplete'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'LocationAutocompleteSuggestion'; ofType: null; }; }; }; } }; 'me': { name: 'me'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'User'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'INTERFACE'; name: 'Node'; ofType: null; } }; 'nodes': { name: 'nodes'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'INTERFACE'; name: 'Node'; ofType: null; }; }; } }; 'plan': { name: 'plan'; type: { kind: 'OBJECT'; name: 'Plan'; ofType: null; } }; 'planInvitation': { name: 'planInvitation'; type: { kind: 'OBJECT'; name: 'PlanInvitation'; ofType: null; } }; 'plans': { name: 'plans'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'QueryPlansConnection'; ofType: null; }; } }; 'productInfo': { name: 'productInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductInfo'; ofType: null; }; } }; 'publishedRecipe': { name: 'publishedRecipe'; type: { kind: 'OBJECT'; name: 'PublishedRecipe'; ofType: null; } }; 'recipeScan': { name: 'recipeScan'; type: { kind: 'OBJECT'; name: 'RecipeScanResult'; ofType: null; } }; 'weatherForecast': { name: 'weatherForecast'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'WeatherForecast'; ofType: null; }; } }; }; }; + 'PublishedWishlist': { kind: 'OBJECT'; name: 'PublishedWishlist'; fields: { 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'publishedAt': { name: 'publishedAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'url': { name: 'url'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; + 'Query': { kind: 'OBJECT'; name: 'Query'; fields: { 'changelog': { name: 'changelog'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ChangelogItem'; ofType: null; }; }; }; } }; 'food': { name: 'food'; type: { kind: 'OBJECT'; name: 'Food'; ofType: null; } }; 'foodCategories': { name: 'foodCategories'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'FoodCategory'; ofType: null; }; }; }; } }; 'foods': { name: 'foods'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'QueryFoodsConnection'; ofType: null; }; } }; 'geographicLocation': { name: 'geographicLocation'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GeographicResult'; ofType: null; }; } }; 'locationAutocomplete': { name: 'locationAutocomplete'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'LocationAutocompleteSuggestion'; ofType: null; }; }; }; } }; 'me': { name: 'me'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'User'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'INTERFACE'; name: 'Node'; ofType: null; } }; 'nodes': { name: 'nodes'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'INTERFACE'; name: 'Node'; ofType: null; }; }; } }; 'plan': { name: 'plan'; type: { kind: 'OBJECT'; name: 'Plan'; ofType: null; } }; 'planInvitation': { name: 'planInvitation'; type: { kind: 'OBJECT'; name: 'PlanInvitation'; ofType: null; } }; 'plans': { name: 'plans'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'QueryPlansConnection'; ofType: null; }; } }; 'productInfo': { name: 'productInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductInfo'; ofType: null; }; } }; 'publishedRecipe': { name: 'publishedRecipe'; type: { kind: 'OBJECT'; name: 'PublishedRecipe'; ofType: null; } }; 'publishedWishlist': { name: 'publishedWishlist'; type: { kind: 'OBJECT'; name: 'PublishedWishlist'; ofType: null; } }; 'recipeScan': { name: 'recipeScan'; type: { kind: 'OBJECT'; name: 'RecipeScanResult'; ofType: null; } }; 'storePageScan': { name: 'storePageScan'; type: { kind: 'OBJECT'; name: 'StorePageScan'; ofType: null; } }; 'weatherForecast': { name: 'weatherForecast'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'WeatherForecast'; ofType: null; }; } }; }; }; 'QueryFoodsConnection': { kind: 'OBJECT'; name: 'QueryFoodsConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'QueryFoodsConnectionEdge'; ofType: null; }; }; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; 'QueryFoodsConnectionEdge': { kind: 'OBJECT'; name: 'QueryFoodsConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Food'; ofType: null; }; } }; }; }; 'QueryPlansConnection': { kind: 'OBJECT'; name: 'QueryPlansConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'QueryPlansConnectionEdge'; ofType: null; }; }; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; @@ -67,6 +69,8 @@ export type introspection = { 'SetUserPreferenceResult': { kind: 'OBJECT'; name: 'SetUserPreferenceResult'; fields: { 'user': { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'User'; ofType: null; }; } }; }; }; 'SetupPlanInput': { kind: 'INPUT_OBJECT'; name: 'SetupPlanInput'; isOneOf: false; inputFields: [{ name: 'priceLookupKey'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'SetupPlanResult': { kind: 'OBJECT'; name: 'SetupPlanResult'; fields: { 'plan': { name: 'plan'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Plan'; ofType: null; }; } }; 'user': { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'User'; ofType: null; }; } }; }; }; + 'StorePageScan': { kind: 'OBJECT'; name: 'StorePageScan'; fields: { 'currency': { name: 'currency'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'imageUrl': { name: 'imageUrl'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'price': { name: 'price'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'productName': { name: 'productName'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'scanner': { name: 'scanner'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'url': { name: 'url'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; + 'StorePageScanInput': { kind: 'INPUT_OBJECT'; name: 'StorePageScanInput'; isOneOf: false; inputFields: [{ name: 'url'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'String': unknown; 'StripeCheckoutData': { kind: 'OBJECT'; name: 'StripeCheckoutData'; fields: { 'clientSecret': { name: 'clientSecret'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'subscriptionId': { name: 'subscriptionId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; 'TemperatureUnit': { name: 'TemperatureUnit'; enumValues: 'Celsius' | 'Fahrenheit' | 'Kelvin'; }; diff --git a/tsconfig.json b/tsconfig.json index 21c1489d..ecf37313 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,8 +20,9 @@ "customConditions": ["development"], "plugins": [ { - "name": "@0no-co/graphqlsp", - "schema": "./server/schema.graphql" + "name": "gql.tada/ts-plugin", + "schema": "./server/schema.graphql", + "tadaOutputLocation": "./packages/client/src/graphql-env.d.ts" } ] },