概要
StrapiのREST APIの一部設定に関する備忘録です。
検索結果の上限を変更する
以下に記載がありました。
https://docs.strapi.io/dev-docs/api/rest/sort-pagination#pagination
具体的には、以下です。
The default and maximum values for pagination[limit] can be configured in the ./config/api.js file with the api.rest.defaultLimit and api.rest.maxLimit keys.
STATEがDraftのものも含めて取得する
デフォルトではSTATEがDraftのものは取得できませんでした。以下の記事が参考になりました。
具体的には以下のようなクエリパラメータを追加することで取得できました。
?publicationState=preview&filters[publishedAt][$null]=true
まとめ
Strapiの利用にあたり、参考になりましたら幸いです。