Giter Site home page Giter Site logo

vendure-subscription-plugin's Introduction

Vendure Subscription Plugin

This is a plugin for the Vendure e-commerce framework designed for recording emails and phones for subscriptions/newsletter.

After setting of your vendure project, you can just use this plugin via npm install:

npm install vendure-subscription-plugin

and then include it to vendure-config file as below:


import { SubscriptionPlugin } from "vendure-subscription-plugin";
...
export const config: VendureConfig = {
  ...
  plugins: [
    ...,
	SubscriptionPlugin
  ]
}

Optionally for Admin UI extension, you may just add via following manner:

AdminUiPlugin.init({
 ...	
  app: compileUiExtensions({
    outputPath: path.join(__dirname, '....'),
	 extensions: [
		...
		SubscriptionPlugin.uiExtensions,
		...
     ]
  }),
 ...
})

The types, inputs and mutations updated after installing the plugin are:

Main Type

type Email implements Node {
 id: ID!
 email: String!
 createdAt: DateTime!
 updatedAt: DateTime!
}

type Phone implements Node {
 id: ID!
 phone: String!
 createdAt: DateTime!
 updatedAt: DateTime!
}	

Inputs

input EmailAddInput{
  email: String!
}
	
input PhoneAddInput{
  phone: String!
}
  
input EmailUpdateInput{
  id: ID!
  email: String!
}
	
input PhoneUpdateInput{
  id: ID!
  phone: String!
}
  
input EmailListOptions

input PhoneListOptions

Shop Mutation

extend type Mutation {
 addSubscriptionEmail(input:[EmailAddInput!]!): [Email]!
}
	
extend type Mutation {
 addSubscriptionPhone(input:[PhoneAddInput!]!): [Phone]!
}	

Admin Type, Query and Mutation

type EmailList implements PaginatedList {
 items: [Email!]!
 totalItems: Int!
}
	
type PhoneList implements PaginatedList {
 items: [Phone!]!
 totalItems: Int!
}
	
extend type Query {
 SubscriptionEmails(options: EmailListOptions): EmailList!
 SubscriptionEmail(id:ID!):Email
		
 SubscriptionPhones(options: PhoneListOptions): PhoneList!
 SubscriptionPhone(id:ID!):Phone
}
	
extend type Mutation {
 addSubscriptionEmail(input:[EmailAddInput!]!): [Email]!
 updateSubscriptionEmail(input:[EmailUpdateInput!]!): [Email]!
 deleteSubscriptionEmail(id:[ID!]!): [Email]!
 deleteAllSubscriptionEmails: Boolean!
		
 addSubscriptionPhone(input:[PhoneAddInput!]!): [Phone]!
 updateSubscriptionPhone(input:[PhoneUpdateInput!]!): [Phone]!
 deleteSubscriptionPhone(id:[ID!]!): [Phone]!
 deleteAllSubscriptionPhones: Boolean!
}

vendure-subscription-plugin's People

Contributors

beeplovekarki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.