kulley 6 年 前
コミット
1eb41d6419
2 ファイル変更4 行追加3 行削除
  1. 1 1
      src/pages/home/all/index.js
  2. 3 2
      src/utils/gql.js

+ 1 - 1
src/pages/home/all/index.js

@@ -91,7 +91,7 @@ class All extends Component {
                 </Query>
                 <WhiteSpace/>
                 <div className='guess-wrap'>
-                    <Query query={gql(productbyprops)} variables={{status: '1'}}>
+                    <Query query={gql(productbyprops)} variables={{status: '1', recommend: 1}}>
                         {
                             ({loading, error, data}) => {
                                 if (loading) {

+ 3 - 2
src/utils/gql.js

@@ -10,8 +10,9 @@ const category_by_props = `
 `
 
 const productbyprops = `
-    query productbyprops($category_id: ID, $updatedAt: String, $name: String, $createdAt: String, $status: String, $intro: String, $price: Float, $img: String, $stock: Int) {
-        productbyprops: product_by_props(category_id: $category_id updatedAt: $updatedAt name: $name createdAt: $createdAt status: $status intro: $intro price: $price img: $img stock: $stock) {
+    query productbyprops($recommend: Int, $where: product_filter, $sort_by: product_sort_by, $limit: Int, $unit: String, $order_by: OrderBy, $name: String, $filter: Filter, $status: String, $price: Float, $category_id: ID, $img: String, $stock: Int, $skip: Int) {
+        productbyprops: product_by_props(recommend: $recommend where: $where sort_by: $sort_by limit: $limit unit: $unit order_by: $order_by name: $name filter: $filter status: $status price: $price category_id: $category_id img: $img stock: $stock skip: $skip) {
+            recommend
             category_id{
                 id
                 name