Skip to content

Commit

Permalink
refactor: Update types in index.d.ts to match GraphQL fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
scottyzen committed Aug 19, 2024
1 parent d9dcbaf commit 943cfd5
Showing 1 changed file with 6 additions and 41 deletions.
47 changes: 6 additions & 41 deletions woonuxt_base/app/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
type Cart = import('#gql').GetCartQuery['cart'];
type Customer = import('#gql').GetCartQuery['customer'];
type Viewer = import('#gql').GetCartQuery['viewer'];
type PaymentGateways = import('#gql').GetCartQuery['paymentGateways'];
type ProductBase = import('#gql').GetProductQuery['product'];
type Cart = import('#gql').CartFragment;
type Customer = import('#gql').CustomerFragment;
type Viewer = import('#gql').ViewerFragment;
type PaymentGateways = import('#gql').PaymentGatewaysFragment;
type Order = import('#gql').OrderFragmentFragment;
type ProductBase = import('#gql').GetProductQuery['product'];
type SimpleProduct = import('#gql').SimpleProductFragment;
type VariableProduct = import('#gql').VariableProductFragment;
type DownloadableItem = import('#gql').DownloadableItemFragment;
type ProductCategory = import('#gql').ProductCategoryFragment;
type Product = ProductBase & SimpleProduct & VariableProduct;
type Address = import('#gql').AddressFragment;
type Terms = import('#gql').TermsFragment;

interface ProductAttributeInput {
attributeName: string;
Expand All @@ -28,29 +29,6 @@ interface ProductAttribute {
visible?: boolean | null;
}

interface ProductTerm {
taxonomyName?: string | null;
slug?: string | null;
}

interface Author {
name?: string | null;
avatar?: { url?: string | null } | null;
}

interface Review {
rating?: number | null;
content?: string | null;
id?: string | null;
date?: string | null;
author?: { node?: Author | null } | null;
}

interface Reviews {
averageRating?: number | null;
edges?: Array<{ rating?: number | null; node?: Review | null }> | null;
}

interface Variation {
name?: string | null;
databaseId?: number;
Expand All @@ -73,19 +51,6 @@ interface ProductImage {
title?: string | null | undefined;
}

interface CartItem {
quantity?: number | null;
key: string;
product?: Product | null;
variation?: { node: Variation } | null;
}

interface CartContents {
itemCount?: number | null;
productCount?: number | null;
nodes?: CartItem[];
}

interface PaymentGateway {
title?: string | null;
id?: string | null;
Expand Down

0 comments on commit 943cfd5

Please sign in to comment.