这是什么规范?

2019-04-03 11:16:40 +08:00
 seaguest

发现一个 app 的请求都只是一个 url,POST 请求的 body 指定了一些返回的参数,结构,貌似可能背后使用微服务实现的,有人知道这个是什么情况吗?

请求的 body json 是这样的:

[
  {
    "variables": {
      "count": 10,
      "page": 1,
      "params": "device=android&ep=product&src=wishlist&item=5&page=1&user_id=321"
    },
    "operationName": null,
    "query": "query wishlis--此处详见下面这段"
  }
]
query wishlist($page: Int, $count: Int, $params: String){
  wishlist(page: $page, count: $count){

      has_next_page
      total_data
      items {
        id
        name
        url
        image_url
        raw_price
        condition
        available
        status
        price
        minimum_order
        wholesale_price {
          minimum
          maximum
          price
        }
        shop {
          id
          name
          url
          gold_merchant
          official_store
          status
          location

        }
        preorder
        badges {
          title
          image_url
        }
        labels {
          title
          color
        }
      }
      pagination {
        next_url
      }
  }

  productAds: displayAdsV3(displayParams: $params) {
      status {
        error_code
        message
      }
    header {
      process_time
      total_data
    }
    data{
      id
      ad_ref_key
      redirect
      sticker_id
      sticker_image
      product_click_url
      product_wishlist_url
      shop_click_url
      product{
        id
        name
        image{
          m_url
          s_url
          xs_url
          m_ecs
          s_ecs
          xs_ecs
        }
        uri
        relative_uri
        price_format
        wholesale_price {
          price_format
          quantity_max_format
          quantity_min_format
        }
        count_talk_format
        count_review_format
        category {
          id
        }
        product_preorder
        product_wholesale
        free_return
        product_cashback
        product_new_label
        product_cashback_rate
        product_rating
        top_label
        bottom_label
      }
      shop{
        id
        name
        domain
        location
        city
        gold_shop
        gold_shop_badge
        lucky_shop
        uri
        owner_id
        is_owner
        badges{
          title
          image_url
          show
        }
      }
      applinks
    }
  }
}
988 次点击
所在节点    问与答
1 条回复
sheeta
2019-04-03 12:00:12 +08:00
GraphQL

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/551578

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX