Help with FindOptions on ParseQuery JS SDK

I was testing the Find() query, and according to the guide ParseQuery - Documentation
it supposed to accept 4 options:

  • useMasterKey
  • sessionToken
  • context
  • json

The IDE doesn’t autocomplete the last 2 options, also I did find 2 more:

  • error
  • success

any idea if the context and the json option exists?

Yes, both options exist: https://github.com/parse-community/Parse-SDK-JS/blob/alpha/src/ParseQuery.js#L653

Hi Davi,
I assume VSCode complains about those options because I am using DefinitelyTyped @types/parse the file shows

Type definitions for parse 2.18

so I assume that are not up to date.

I am not sure if I can understand the code in the link, I tried to @ts-ignore/disable the eslint/ts but I am not sure how to do it (or the error keeps showing up), also in the code (line 694) says if (options.json) {... how this option will be passed?

  1. query.find( json )
  2. query.find( ‘json’ )
  3. query.find( {json: true} )

Error example:

Argument of type '{ context: { notifyTeam: boolean; }; }' is not assignable to parameter of type 'FindOptions'.
Object literal may only specify known properties, and 'context' does not exist in type 'FindOptions'.ts(2345)

The types are probably not updated. You can open a PR to definitely typed to add them. Otherwise, I’d try with (query as any).find( {json: true} )