User Tools

Site Tools


udropship:umarketplace:m2:vendor-info-graphql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
udropship:umarketplace:m2:vendor-info-graphql [2021/02/18 17:07]
wtsergo
udropship:umarketplace:m2:vendor-info-graphql [2021/09/06 19:02]
wtsergo [Get list of Vendor Products]
Line 344: Line 344:
         }         }
       ]       ]
 +    }
 +  }
 +}
 +</code>
 +
 +Magento native version of above query is
 +
 +''
 +Example:
 +''
 +<code>
 +{
 +  products(
 +    filter: { udropship_vendor: { eq: "1"} }
 +  ) {
 +    items {
 +      name
 +      sku
     }     }
   }   }
Line 449: Line 467:
 } }
 </code> </code>
 +
 +===== Get product questions to vendors =====
 +
 +''
 +Example:
 +''
 +<code>
 +{
 +  vendorProductQuestions(sku: "24-WB04") {
 +    questionText
 +    answerText
 +    customerName
 +    vendorId
 +    vendorName
 +    visibility
 +    questionDate
 +    answerDate
 +  }
 +}
 +</code>
 +''
 +RESPONSE
 +''
 +<code>
 +{
 +  "data": {
 +    "vendorProductQuestions": [
 +      {
 +        "questionText": "test question",
 +        "answerText": "test answer",
 +        "customerName": "test 1",
 +        "vendorId": "1",
 +        "vendorName": "vendor1",
 +        "visibility": "1",
 +        "questionDate": "2021-02-15 21:41:00",
 +        "answerDate": "2021-02-15 21:45:51"
 +      },
 +      {
 +        "questionText": "test 2 question",
 +        "answerText": "test 2 answer",
 +        "customerName": "test 2",
 +        "vendorId": "1",
 +        "vendorName": "vendor1",
 +        "visibility": "1",
 +        "questionDate": "2021-02-15 21:41:51",
 +        "answerDate": "2021-02-15 21:45:48"
 +      }
 +    ]
 +  }
 +}
 +</code>
 +
 +===== Ask product question to vendor =====
 +
 +Before run this mutation you need to obtain customer token via //generateCustomerToken// mutation [[https://devdocs.magento.com/guides/v2.4/graphql/mutations/generate-customer-token.html]] and use it in Authorization: Bearer <token> header.
 +
 +''
 +Example:
 +''
 +<code>
 +mutation {
 +  askProductQuestion (input: {
 +    vendorId: 3,
 +    sku: "24-MB01",
 +    email: "wtsergo@gmail.com",
 +    name: "gql test",
 +    question: "gql test question",
 +    visibility: 1
 +  })
 +}
 +</code>
 +''
 +RESPONSE
 +''
 +<code>
 +{
 +  "data": {
 +    "askProductQuestion": true
 +  }
 +}
 +</code>
 +
 +===== Get vendor reviews =====
 +
 +''
 +Example:
 +''
 +<code>
 +{
 +  vendorReviews(vendorId: 1) {
 +    detail
 +    nickname
 +    createdAt
 +    ratingVotes {
 +        ratingCode
 +        isAggregate
 +        percent
 +        value
 +    }
 +  }
 +}
 +</code>
 +''
 +RESPONSE
 +''
 +<code>
 +{
 +  "data": {
 +    "vendorReviews": [
 +      {
 +        "detail": "test 000000003 description",
 +        "nickname": "test",
 +        "createdAt": "2021-02-15 22:21:09",
 +        "ratingVotes": [
 +          {
 +            "ratingCode": "Vendor Quality",
 +            "isAggregate": "1",
 +            "percent": "80",
 +            "value": "4"
 +          },
 +          {
 +            "ratingCode": "Is Quality OK",
 +            "isAggregate": "0",
 +            "percent": "20",
 +            "value": "1"
 +          }
 +        ]
 +      },
 +      {
 +        "detail": "test 000000007-1 description",
 +        "nickname": "test",
 +        "createdAt": "2021-02-15 22:21:30",
 +        "ratingVotes": [
 +          {
 +            "ratingCode": "Vendor Quality",
 +            "isAggregate": "1",
 +            "percent": "60",
 +            "value": "3"
 +          },
 +          {
 +            "ratingCode": "Is Quality OK",
 +            "isAggregate": "0",
 +            "percent": "0",
 +            "value": "0"
 +          }
 +        ]
 +      },
 +      {
 +        "detail": "test 000000006-1 review details",
 +        "nickname": "test",
 +        "createdAt": "2021-02-15 22:21:53",
 +        "ratingVotes": [
 +          {
 +            "ratingCode": "Vendor Quality",
 +            "isAggregate": "1",
 +            "percent": "100",
 +            "value": "5"
 +          },
 +          {
 +            "ratingCode": "Is Quality OK",
 +            "isAggregate": "0",
 +            "percent": "20",
 +            "value": "1"
 +          }
 +        ]
 +      }
 +    ]
 +  }
 +}
 +</code>
 +
  
udropship/umarketplace/m2/vendor-info-graphql.txt · by wtsergo