graphql

package
v0.0.0-...-bb92df6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2021 License: OSL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

Package graphql generated by go-bindata.// sources: schema.graphql

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("nonexistent") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type CommerceCartMutationResolver

type CommerceCartMutationResolver struct {
	// contains filtered or unexported fields
}

CommerceCartMutationResolver resolves cart mutations

func (*CommerceCartMutationResolver) CartClean

func (r *CommerceCartMutationResolver) CartClean(ctx context.Context) (bool, error)

CartClean clears users cart

func (*CommerceCartMutationResolver) CommerceAddToCart

func (r *CommerceCartMutationResolver) CommerceAddToCart(ctx context.Context, marketplaceCode string, qty int, deliveryCode string) (*dto.DecoratedCart, error)

CommerceAddToCart mutation for adding products to the current users cart

func (*CommerceCartMutationResolver) CommerceCartApplyCouponCodeOrGiftCard

func (r *CommerceCartMutationResolver) CommerceCartApplyCouponCodeOrGiftCard(ctx context.Context, code string) (*dto.DecoratedCart, error)

CommerceCartApplyCouponCodeOrGiftCard – apply coupon code or gift card

func (*CommerceCartMutationResolver) CommerceCartRemoveCouponCode

func (r *CommerceCartMutationResolver) CommerceCartRemoveCouponCode(ctx context.Context, couponCode string) (*dto.DecoratedCart, error)

CommerceCartRemoveCouponCode - remove coupon code

func (*CommerceCartMutationResolver) CommerceCartRemoveGiftCard

func (r *CommerceCartMutationResolver) CommerceCartRemoveGiftCard(ctx context.Context, giftCardCode string) (*dto.DecoratedCart, error)

CommerceCartRemoveGiftCard - remove gift card

func (*CommerceCartMutationResolver) CommerceCartUpdateBillingAddress

func (r *CommerceCartMutationResolver) CommerceCartUpdateBillingAddress(ctx context.Context, address *cartForms.AddressForm) (*dto.BillingAddressForm, error)

CommerceCartUpdateBillingAddress resolver method

func (*CommerceCartMutationResolver) CommerceCartUpdateDeliveryAddresses

func (r *CommerceCartMutationResolver) CommerceCartUpdateDeliveryAddresses(ctx context.Context, deliveryForms []*forms.DeliveryForm) ([]*dto.DeliveryAddressForm, error)

CommerceCartUpdateDeliveryAddresses can be used to update or set one or multiple delivery addresses, uses the delivery form controller

func (*CommerceCartMutationResolver) CommerceCartUpdateDeliveryShippingOptions

func (r *CommerceCartMutationResolver) CommerceCartUpdateDeliveryShippingOptions(ctx context.Context, shippingOptions []*dto.DeliveryShippingOption) ([]*dto.DeliveryAddressForm, error)

CommerceCartUpdateDeliveryShippingOptions updates the method/carrier of one or multiple existing deliveries

func (*CommerceCartMutationResolver) CommerceCartUpdateSelectedPayment

func (r *CommerceCartMutationResolver) CommerceCartUpdateSelectedPayment(ctx context.Context, gateway string, method string) (*dto.SelectedPaymentResult, error)

CommerceCartUpdateSelectedPayment resolver method

func (*CommerceCartMutationResolver) CommerceDeleteCartDelivery

func (r *CommerceCartMutationResolver) CommerceDeleteCartDelivery(ctx context.Context, deliveryCode string) (*dto.DecoratedCart, error)

CommerceDeleteCartDelivery mutation for removing deliveries from current users cart

func (*CommerceCartMutationResolver) CommerceDeleteItem

func (r *CommerceCartMutationResolver) CommerceDeleteItem(ctx context.Context, itemID string, deliveryCode string) (*dto.DecoratedCart, error)

CommerceDeleteItem resolver

func (*CommerceCartMutationResolver) CommerceUpdateItemQty

func (r *CommerceCartMutationResolver) CommerceUpdateItemQty(ctx context.Context, itemID string, deliveryCode string, qty int) (*dto.DecoratedCart, error)

CommerceUpdateItemQty mutation for updating item quantity

func (*CommerceCartMutationResolver) Inject

func (r *CommerceCartMutationResolver) Inject(q *CommerceCartQueryResolver,
	billingAddressFormController *cartForms.BillingAddressFormController,
	deliveryFormController *cartForms.DeliveryFormController,
	formDataEncoderFactory formApplication.FormDataEncoderFactory,
	simplePaymentFormController *cartForms.SimplePaymentFormController,
	cartService *application.CartService,
	cartReceiverService *application.CartReceiverService) *CommerceCartMutationResolver

Inject dependencies

type CommerceCartQueryResolver

type CommerceCartQueryResolver struct {
	// contains filtered or unexported fields
}

CommerceCartQueryResolver resolver for carts

func (*CommerceCartQueryResolver) CartSplit

CartSplit returns graphql specific cart split

func (*CommerceCartQueryResolver) CommerceCart

CommerceCart getter for queries

func (*CommerceCartQueryResolver) CommerceCartQtyRestriction

func (r *CommerceCartQueryResolver) CommerceCartQtyRestriction(ctx context.Context, marketplaceCode string, variantCode *string, deliveryCode string) (*validation.RestrictionResult, error)

CommerceCartQtyRestriction checks if given sku is restricted in terms of qty

func (*CommerceCartQueryResolver) CommerceCartValidator

func (r *CommerceCartQueryResolver) CommerceCartValidator(ctx context.Context) (*validation.Result, error)

CommerceCartValidator to trigger the cart validation service

func (*CommerceCartQueryResolver) Inject

func (r *CommerceCartQueryResolver) Inject(
	applicationCartReceiverService *application.CartReceiverService,
	cartService *application.CartService,
	restrictionService *validation.RestrictionService,
	productService domain.ProductService,
)

Inject dependencies

type Resolver

type Resolver struct{}

Resolver helper

func (*Resolver) GetDeliveryByCodeWithoutBool

func (*Resolver) GetDeliveryByCodeWithoutBool(_ context.Context, cart *cart.Cart, code string) (*cart.Delivery, error)

GetDeliveryByCodeWithoutBool helper

type Service

type Service struct{}

Service describes the Commerce/Cart GraphQL Service

func (*Service) Schema

func (*Service) Schema() []byte

Schema for cart, delivery and addresses

func (*Service) Types

func (*Service) Types(types *graphql.Types)

Types configures the GraphQL to Go resolvers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL