Skip to content

Commit d710d27

Browse files
committed
Enhance query parameter handling and update documentation for Strapi REST requests
- Add `qs` library for advanced query parameter serialization - Refactor `makeRestRequest` to use `qs.stringify` for flexible parameter parsing - Update README with more nuanced documentation on query parameters and population - Remove default population and pagination in REST requests - Improve tool description to emphasize selective and minimal querying
1 parent 133445f commit d710d27

File tree

4 files changed

+39
-1038
lines changed

4 files changed

+39
-1038
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ strapi_rest({
9191
$contains: "search term",
9292
},
9393
},
94-
populate: "*",
9594
},
9695
});
9796

@@ -153,7 +152,7 @@ strapi_upload_media({
153152
2. Use proper plural/singular forms for endpoints
154153
3. Include error handling in your queries
155154
4. Validate URLs before upload
156-
5. Use appropriate content population strategies
155+
5. Start with minimal queries and add population only when needed
157156
6. Always include the complete data object when updating
158157
7. Use filters to optimize query performance
159158
8. Leverage built-in schema validation
@@ -209,17 +208,20 @@ params: {
209208
### Population
210209

211210
```javascript
212-
// Populate all relations
211+
// Basic request without population
213212
params: {
214-
populate: "*"
215213
}
216214

217-
// Populate specific fields
215+
// Selective population when needed
216+
params: {
217+
populate: ["category"];
218+
}
219+
220+
// Detailed population with field selection
218221
params: {
219222
populate: {
220-
category: true,
221-
author: {
222-
fields: ["name", "email"]
223+
category: {
224+
fields: ["name", "slug"];
223225
}
224226
}
225227
}

0 commit comments

Comments
 (0)