# Graph Ql

From magento 2.3.x you can use GraphQl on magento 2.

For our module you should setup graphql module at here: <https://github.com/landofcoder/module-marketplace-graphql>

### Queries

1. Get Seller Profile Info By Id

```
{
    lofSellerById(seller_id: Int!) {
        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
        }
  }
}
```

1. Get List Sellers with Filter options

```
{
    lofSellerList (
        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
            }
        }
    }
}
```

1. 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
}

lofProductBySellerId(
    seller_id: Int!
    search: String = ""
    filter: ProductAttributeFilterInput
    pageSize: Int = 20
    currentPage: Int = 1
    sort: ProductAttributeSortInput
  ) {
    items {
      ...ShopProduct
    }
    page_info {
      ...PageInfo
    }
    total_count
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://landofcoder.gitbook.io/magento-2-marketplace/rest-api-and-graph-ql/graph-ql.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
