Skip to content

Conversation

@philipp-tailor
Copy link
Contributor

Motivation: Consistency of the local API with the req parameter of requests made via the Rest / GraphQL API.

Before this change, if hooks relied on req.query.depth, req: {query: {depth: x}} would have to be manually passed to local API calls such as payload.find({}), in addition to depth: x. This was easy to forget, in which case the local API calls would result in different outcomes than if the same operation was triggered via Rest / GraphQL. This was confusing.

Motivation: consistency with the Rest / GraphQL API. If hooks rely
on `req.query.depth`, `req: {query: {depth: x}}` would have to be
manually passed to local API calls such as `payload.find({})`, in
addition to `depth: x`. This was easy to forget, in which case the
local API calls would result in different outcomes than if the same
operation was triggered via Rest / GraphQL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant