Skip to content

validateAndTransformQuery "defaults" field #10817

Closed Answered by olivermrbl
qFlensT asked this question in Q&A
Discussion options

You must be logged in to vote

@qFlensT, * is not a valid property to specify in fields on the root resource. You can use it to pick all fields on relations, but for the root resource, you need to explicitly specify the fields to include.

In your case, this would look something along the lines of:

middlewares: [
  validateAndTransformQuery(siteContentsQuerySchema, {
    defaults: ["id", "name", "page_key", "is_active", "config", "*[some_relation]"],
    isList: true,
  }),
],

That said, it might make sense to support this query config–we'll discuss this internally.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@qFlensT
Comment options

Answer selected by qFlensT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants