dos: add docs on overriding allowed fields in routes (#12233)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-04-18 11:38:36 +03:00
1 parent 28958b2e26
commit a3aa5d7a66
45 files changed
+17052 -16618

No files matched your search

+29
View File
@@ -639,6 +639,35 @@ This returns the variants of each product, but the variants only have their `id`
</DividedMarkdownLayout>
<DividedMarkdownLayout>
<DividedMarkdownContent>
### Select Custom Linked Data Models
Most of the API routes that accept a `fields` query parameter allow you to specify custom linked data models. For example, if you linked a `Brand` to a `Product`, you can pass `brand` in the `fields` query parameter to retrieve the brand of each product.
However, some API routes restrict the fields and relations you can retrieve. To learn about those API routes and how to override the allowed fields and relations, refer to the [Retrieve Custom Linked Data Models from Medusa's API routes](!docs!/learn/fundamentals/api-routes/retrieve-custom-links) documentation.
</DividedMarkdownContent>
</DividedMarkdownLayout>
<DividedMarkdownLayout>
<Feedback
event="survey_api-ref"
extraData={{
area: "admin",
section: "select-fields"
}}
pathName="/api/admin"
question="Was this section helpful?"
vertical={true}
/>
</DividedMarkdownLayout>
</SectionContainer>
<SectionContainer noTopPadding={true}>