sdk-for-node icon indicating copy to clipboard operation
sdk-for-node copied to clipboard

Update query.js

Open CodesbyRobot opened this issue 3 years ago • 4 comments
trafficstars

static equal = (attribute, value) => ^

SyntaxError: Unexpected token =

CodesbyRobot avatar Jan 16 '22 17:01 CodesbyRobot

static equal = (attribute, value) => ^

SyntaxError: Unexpected token =

Incorrectly set static property.

CodesbyRobot avatar Jan 16 '22 17:01 CodesbyRobot

@CodesbyRobot Can you please mention the nodejs version you are using that's giving the issue?

lohanidamodar avatar Mar 23 '22 11:03 lohanidamodar

Node 10.19.0

CodesbyRobot avatar Mar 30 '22 12:03 CodesbyRobot

Hey there 👋

  • I can confirm our current syntax does not work in Node 10.x. I can also confirm your syntax will work on 0.10, AND new newer versions
  • You marked all methods async, which is not required. Query is a utility class that takes input, and generated string. Everything is sync, we don't need to await them.
  • Make sure to add return statements into the methods, because with this new syntax, a return keyword is required. Example:
  static equal(attribute, value) {
    return Query.addQuery(attribute, "equal", value);
  }
  • Our SDK libraries are read-only, as they are automatically generated from our SDK generator. This helps us automate 90% of maintenance, and keep the remaining 10% in one place. Could you please look at this repository and try to apply these changes there? The same changes might be valuable for Deno and Web SDKs.

Happy to help if you have any questions or concerns 😇

Meldiron avatar Apr 07 '22 08:04 Meldiron

Closing because of Matej's comments and this is stale now.

stnguyen90 avatar Nov 02 '22 15:11 stnguyen90