@duely/client
Advanced tools
Comparing version 0.4.49 to 0.4.50
{ | ||
"name": "@duely/client", | ||
"version": "0.4.49", | ||
"version": "0.4.50", | ||
"description": "GraphQL client by Duely (wrapper for @apollo/client)", | ||
@@ -5,0 +5,0 @@ "repository": "github:uoleevi/duely", |
@@ -16,2 +16,3 @@ import { ApolloCache, MutationOptions, NormalizedCacheObject, Reference } from '@apollo/client'; | ||
CreateProductDocument, | ||
CreatePromotionCodeDocument, | ||
CustomerFragmentDoc, | ||
@@ -48,2 +49,3 @@ DeleteBankAccountDocument, | ||
UpdateProductSettingsDocument, | ||
UpdatePromotionCodeDocument, | ||
UpdateThemeDocument, | ||
@@ -64,3 +66,4 @@ VerifyPasswordResetDocument, | ||
customers_Q, | ||
products_Q | ||
products_Q, | ||
promotion_codes_Q | ||
} from '../queries'; | ||
@@ -300,2 +303,24 @@ // import produce from 'immer'; | ||
const create_promotion_code_R = (d: ResultOf<typeof CreatePromotionCodeDocument>) => | ||
d?.create_promotion_code; | ||
export const create_promotion_code_M = { | ||
mutation: CreatePromotionCodeDocument, | ||
result: create_promotion_code_R, | ||
async after( | ||
cache: ApolloCache<NormalizedCacheObject>, | ||
result: ReturnType<typeof create_promotion_code_R> | null | ||
) { | ||
if (!result?.success || !result.promotion_code) return; | ||
evictQuery(cache, promotion_codes_Q.query); | ||
cache.gc(); | ||
} | ||
}; | ||
export const update_promotion_code_M = { | ||
mutation: UpdatePromotionCodeDocument, | ||
result: (d: ResultOf<typeof UpdatePromotionCodeDocument>) => d?.update_promotion_code | ||
}; | ||
const create_invoice_R = (d: ResultOf<typeof CreateInvoiceDocument>) => d?.create_invoice; | ||
@@ -353,3 +378,4 @@ export const create_invoice_M = { | ||
const mark_invoice_uncollectible_R = (d: ResultOf<typeof MarkInvoiceUncollectibleDocument>) => d?.mark_invoice_uncollectible; | ||
const mark_invoice_uncollectible_R = (d: ResultOf<typeof MarkInvoiceUncollectibleDocument>) => | ||
d?.mark_invoice_uncollectible; | ||
export const mark_invoice_uncollectible_M = { | ||
@@ -360,3 +386,4 @@ mutation: FinalizeInvoiceDocument, | ||
const create_invoiceitem_R = (d: ResultOf<typeof CreateInvoiceItemDocument>) => d?.create_invoiceitem; | ||
const create_invoiceitem_R = (d: ResultOf<typeof CreateInvoiceItemDocument>) => | ||
d?.create_invoiceitem; | ||
export const create_invoiceitem_M = { | ||
@@ -382,3 +409,4 @@ mutation: CreateInvoiceItemDocument, | ||
const delete_invoiceitem_R = (d: ResultOf<typeof DeleteInvoiceItemDocument>) => d?.delete_invoiceitem; | ||
const delete_invoiceitem_R = (d: ResultOf<typeof DeleteInvoiceItemDocument>) => | ||
d?.delete_invoiceitem; | ||
export const delete_invoiceitem_M = { | ||
@@ -385,0 +413,0 @@ mutation: DeleteInvoiceItemDocument, |
@@ -67,3 +67,5 @@ import { | ||
InvoiceDocument, | ||
AgencyStripeAccountInvoiceItemsDocument | ||
AgencyStripeAccountInvoiceItemsDocument, | ||
PromotionCodeDocument, | ||
PromotionCodesDocument | ||
} from '@duely/core'; | ||
@@ -464,2 +466,12 @@ import { QueryOptions } from '@apollo/client'; | ||
export const promotion_code_Q = { | ||
query: PromotionCodeDocument, | ||
result: (d: ResultOf<typeof PromotionCodeDocument>) => d?.promotion_code | ||
}; | ||
export const promotion_codes_Q = { | ||
query: PromotionCodesDocument, | ||
result: (d: ResultOf<typeof PromotionCodesDocument>) => d?.promotion_codes | ||
}; | ||
export const page_Q = { | ||
@@ -466,0 +478,0 @@ query: PageDocument, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
587828
7652