Strapi:响应中的自定义字段

时间:2020-09-13 06:55:45

标签: graphql strapi restapi

任何人都可以帮助您如何自定义或删除Strapi API响应中的某些字段。 例如默认情况下,Strapi将包含如下字段:

updated_by, 由...制作, createdAt, UpdatedAt, __v, _ID, ID

样本响应JSON

[{
    "_id": "5f5bcb3fc444444400000",
    "feature_name": "Latest News",
    "feature_shortcode": "latest",
    "feature_order": 12,
    "createdAt": "2020-09-11T19:08:47.576Z",
    "updatedAt": "2020-09-11T19:08:47.715Z",
    "__v": 0,
    "created_by": {
      "_id": "5iasdf98a7dsf98a7s98fd",
      "username": null,
      "firstname": "xxxxx",
      "lastname": "xxxxxx",
      "createdAt": "2020-09-11T18:53:45.626Z",
      "updatedAt": "2020-09-11T18:53:45.775Z",
      "__v": 0,
      "id": "lkajsfd98as9df8590e130f235c"
    },
    "updated_by": {
      "_id": "5f5bc7b9245b590e130f235c",
      "username": null,
      "firstname": "xxxxx",
      "lastname": "xxxxxxx",
      "createdAt": "2020-09-11T18:53:45.626Z",
      "updatedAt": "2020-09-11T18:53:45.775Z",
      "__v": 0,
      "id": "5f5bc7bsdfasdf90e130f235c"
    },
    "id": "5fasdfhgthrth4f3e620f"
  }
  ]

如何配置它以仅显示在集合中创建的字段? (feature_name,feature_shortcode,feature_order)

0 个答案:

没有答案