landofcoder / module-marketplace-graphql
Magento 2 Marketplace GraphQl extension
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 2
Open Issues: 0
Type:magento2-module
Requires
- landofcoder/module-marketplace: *
- dev-master
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-upgrade-refactor-246p4
- dev-add-system
- dev-add-get-product-attribute
- dev-fix-get-rating-seller
- dev-update-review-seller-mutation
- dev-new-queries
- dev-update1.0.2
- dev-update-queries
- dev-fix-graphql-issue
- dev-refactor-graphql-resolver
- dev-update-graphql
This package is auto-updated.
Last update: 2024-11-05 10:36:08 UTC
README
``landofcoder/module-marketplace-graphql
``
Main Functionalities
magento 2 marketplace graphql extension
Marketplace Addons GraphQL Extensions
- Seller Coupon Code
- Seller Chat
- Seller Split Cart
- Seller Product List - Products Slider
- Seller Blog
- Seller Product
- Seller Settings
- Seller Delivery Time Slots
- Comming soon...
Installation
* = in production please use the --keep-generated
option
Type 1: Zip file
- Unzip the zip file in
app/code/Lof
- Enable the module by running
php bin/magento module:enable Lof_MarketplaceGraphQl
- Apply database updates by running
php bin/magento setup:upgrade
* - Flush the cache by running
php bin/magento cache:flush
Type 2: Composer
- Make the module available in a composer repository for example:
- private repository
repo.magento.com
- public repository
packagist.org
- public github repository as vcs
- private repository
- Add the composer repository to the configuration by running
composer config repositories.repo.magento.com composer https://repo.magento.com/
- Install the module composer by running
composer require landofcoder/module-marketplace-graphql
- enable the module by running
php bin/magento module:enable Lof_MarketplaceGraphQl
- apply database updates by running
php bin/magento setup:upgrade
* - Flush the cache by running
php bin/magento cache:flush
TODO
- Refactor Graphql queries
- Refactor Resolvers
- Add documendation for Graphql queries
Queries
- Get Seller Profile Info By Url
{
sellerByUrl(
seller_url: String! @doc(description: "Seller Url Key")
get_other_info: Boolean = false @doc(description: "Get other info: reviews, ratings, total sales, vacation")
get_products: Boolean = false @doc(description: "Get Latest Products")
) {
address
banner_pic
city
company_description
company_locality
contact_number
country
customer_id
email
gplus_active
gplus_id
group
image
name
page_layout
region
return_policy
sale
seller_id
shipping_policy
shop_title
status
store_id
thumbnail
seller_rates {
items {
created_at
customer_id
detail
email
nickname
rate1
rate2
rate3
rating_id
seller_id
status
title
}
total_count
}
}
}
Example:
{
sellerByUrl(seller_url: "seller1") {
shop_title
thumbnail
logo_pic
banner_pic
url_key
telephone
product_count
total_sold
offers
benefits
product_shipping_info
prepare_time
response_ratio
response_time
creation_time
}
}
- Get Seller Profile By ID
{
sellerById(
seller_id: Int! @doc(description: "Seller id")
get_other_info: Boolean = false @doc(description: "Get other info: reviews, ratings, total sales, vacation")
get_products: Boolean = false @doc(description: "Get Latest Products")
) {
address
banner_pic
city
company_description
company_locality
contact_number
country
customer_id
email
gplus_active
gplus_id
group
image
name
page_layout
region
return_policy
sale
seller_id
shipping_policy
shop_title
status
store_id
thumbnail
seller_rates {
items {
created_at
customer_id
detail
email
nickname
rate1
rate2
rate3
rating_id
seller_id
status
title
}
total_count
}
}
}
Example:
{
sellerById(seller_id: 1) {
shop_title
thumbnail
logo_pic
banner_pic
url_key
telephone
product_count
total_sold
offers
benefits
product_shipping_info
prepare_time
response_ratio
response_time
creation_time
}
}
- Get List Sellers with Filter options
{
sellers (
filter: SellerFilterInput,
pageSize: Int = 20,
currentPage: Int = 1,
sort: SellerSortInput
) {
total_count
items {
seller_rates {
items {
created_at
customer_id
detail
email
nickname
rate1
rate2
rate3
rating_id
seller_id
status
title
}
total_count
}
sale
seller_id
name
thumbnail
country
address
group
products {
items {
sale
id
name
url_key
rating_summary
sku
image {
url
label
}
description {
html
}
short_description {
html
}
product_brand
price_range {
maximum_price {
discount {
amount_off
percent_off
}
final_price {
currency
value
}
regular_price {
currency
value
}
}
minimum_price {
discount {
amount_off
percent_off
}
final_price {
currency
value
}
regular_price {
currency
value
}
}
}
price {
regularPrice {
amount {
currency
}
}
}
}
total_count
}
}
}
}
- Get Seller Collection (Groups)
{
sellerCollection(
filter: SellerGroupFilterInput,
pageSize: Int = 5,
currentPage: Int = 1,
sort: SellerGroupSortInput
) {
total_count
items {
group_id
name
url_key
position
}
}
}
- Filter products by seller ID
fragment ShopProduct on ProductInterface {
id
rating_summary
description {
html
}
name
image {
url
}
url_key
price_range {
minimum_price {
regular_price {
value
currency
}
}
maximum_price {
discount {
percent_off
}
final_price {
value
currency
}
regular_price {
value
}
}
}
}
fragment PageInfo on SearchResultPageInfo {
current_page
page_size
total_pages
}
productsBySellerId(
seller_id: Int!
search: String = ""
filter: ProductAttributeFilterInput
pageSize: Int = 20
currentPage: Int = 1
sort: ProductAttributeSortInput
) {
items {
...ShopProduct
}
page_info {
...PageInfo
}
total_count
}
- Get Seller Products by Seller Url
Example: get products of seller "seller1"
{
productsBySellerUrl(
seller_url: "seller1"
search: ""
filter: {}
pageSize: 1
currentPage: 1
) {
items {
id
name
url_key
rating_summary
sku
stock_status
image {
url
label
}
description {
html
}
short_description {
html
}
price {
regularPrice {
amount {
currency
}
}
}
}
page_info {
page_size
current_page
total_pages
}
total_count
}
}
- Get Seller Information on products query
Example:
{
products(filter: { sku: { eq: "AAAU_B2C-W713327" } }) {
items {
name
sku
url_key
stock_status
price_range {
minimum_price {
regular_price {
value
currency
}
}
}
seller {
shop_title
thumbnail
url_key
telephone
product_count
total_sold
offers
benefits
product_shipping_info
prepare_time
response_ratio
response_time
creation_time
}
}
total_count
page_info {
page_size
}
}
}
- Mutation Registrer Seller
mutation {
registerSeller(
input: {
seller: {
group_id: String
url_key: String!
},
customer: {
firstname: String!
lastname: String!
email: String!
address: {
region_id: String
country_id: String!
city: String!
street: String!
company: String
telephone: String!
postcode: String!
}
},
password: String!
}
) {
code
message
}
}
- Mutation Become Seller - required customer logged in
mutation {
becomeSeller(
input: {
group_id: String
url_key: String!
}
) {
code
message
}
}
- Mutation Review Seller - required customer logged in
mutation {
reviewSeller(
input: {
seller_url : String!
rate1 : Int!
rate2 : Int!
rate3 : Int!
nickname : String!
email : String!
title : String!
detail : String!
}
) {
code
message
}
}
- Mutation Customer send contact to seller - required customer logged in
mutation {
customerSendMessage(
input: {
seller_url : String!
subject : String
content : String!
}
) {
code
message
}
}
- Mutation Customer send reply to a message - required customer logged in
mutation {
customerReplyMessage(
input: {
message_id : Int!
content : String!
}
) {
code
message
}
}
- Query get messages of logged in customer - required customer logged in
{
sellerMessages(
filter: SellerMessageFilterInput
pageSize: Int = 20
currentPage: Int = 1
sort: SellerMessageSortInput
) {
total_count
items {
message_id
description
subject
sender_email
sender_name
created_at
status
is_read
sender_id
owner_id
receiver_id
seller_send
details (
pageSize: Int = 20
currentPage: Int = 1
) {
items {
content
sender_name
sender_email
receiver_name
is_read
created_at
}
total_count
page_info {
...PageInfo
}
}
}
page_info {
...PageInfo
}
}
}
- Query Get Seller Info of Logged in Customer - required customer logged in
{
customer {
firstname
lastname
suffix
email
addresses {
firstname
lastname
street
city
region {
region_code
region
}
postcode
country_code
telephone
}
seller {
shop_title
thumbnail
logo_pic
banner_pic
url_key
telephone
product_count
total_sold
offers
benefits
product_shipping_info
prepare_time
response_ratio
response_time
creation_time
}
}
}
- Get Seller Ratings List by Seller Url Key
Query:
{
sellerRatings(
seller_url: "seller1"
filter: {}
pageSize: 5
currentPage: 1
sort: { created_at: DESC }
) {
items {
rating_id
rate1
rate2
rate3
rate4
rate5
rating
title
status
detail
nickname
created_at
verified_buyer
is_recommended
is_hidden
answer
admin_note
like_about
not_like_about
guest_email
plus_review
minus_review
report_abuse
country
}
total_count
page_info {
page_size
current_page
total_pages
}
}
}