I wanted to add a variant after the order gets placed and am using nodejs app.
Had been following the guide: https://shopify.dev/tutorials/edit-an-existing-order-with-admin-api#add-a-discount-to-the-variant
No one can help you if you do not provide data. Showing off a query is not helpful except in the grossest of syntax errors and your error is clearly not that. Edit your post to show your data, and Shopify also asks you to post a header with the problem request so they can help you debug.