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

This commit is contained in:
Shahed Nasser
2025-04-18 11:38:36 +03:00
committed by GitHub
parent 28958b2e26
commit a3aa5d7a66
45 changed files with 17052 additions and 16618 deletions
+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}>