0.0.2 • Published 4 months ago

gls-favorites-01 v0.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

Plugin de Canal Vendure

Este é um plugin para o framework de e-commerce Vendure projetado para gerenciar os produtos favoritos no projeto Gseller.

Após configurar o seu projeto Vendure, você pode usar este plugin via npm install:

npm install favorites-plugin

e inclua-o no arquivo vendure-config conforme abaixo:

import { FavoritesPlugin } from "favorites-plugin";
...
export const config: VendureConfig = {
  ...
  plugins: [
    ...,
	FavoritesPlugin
  ]
}

Os tipos, entradas e mutações atualizadas após a instalação do plugin são:

Api Inputs

  # Auto-generated at runtime
  input FavoriteListOptions

Api Main Types

 type Favorite implements Node {
    id: ID!
    createdAt: DateTime!
    updatedAt: DateTime!
    product: Product
    customer: Customer!
  }

  type FavoriteList implements PaginatedList {
    items: [Favorite!]!
    totalItems: Int!
  }

  extend type Customer {
    favorites(options: FavoriteListOptions, term: String): FavoriteList!
  }

Admin Query

   extend type Query {
    favorite(id: ID!): Favorite
  }

Shop Query and Mutation

  extend type Mutation {
    toggleFavorite(productId: ID!): FavoriteList!
  }

  extend type Query {
    activeFavorites(options: FavoriteListOptions, term: String): FavoriteList!
  }
0.0.2

4 months ago

0.0.1

4 months ago