1

I am facing an invalid query parameter error from feathersjs back end . i am using react as front end. My request is .

I did not write this code initially. the $includeEc was already there, but that does not create an error. I know $include, $limit are there too and $limit is a feathersjs query.

If I remove $dis, there is no error. I need $dis to validate something on my API.

let data = {
    $include: true,
    $includeEc: true,
    $limit: -1,
    $dis: 91,
  };

let res = await client.service('servicerequest').find({ query: data });

If I remove $dis there is no problem.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

Custom query parameters prefixed with a $ must be explicitly allowed on your feathers service. This was added in feathers 4 in order to improve the default security profile and prevent unwanted params from being passed into the db adapters.

From your example, $limit is part of the common query interface, while the two $include params are likely pre-configured or otherwise allowed by your DB adapter.

Read more about it here: Feathers Service Adapters: Whitelisting

Patrick Fowler
  • 176
  • 4
  • 13