dos: add docs on overriding allowed fields in routes (#12233)
This commit is contained in:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user