Dylan Sather (Pipedream) : Thanks. Instead of the keyy.then... clause, can you run
console.log(keyy)
and see if the value of keyy contains your query results?
Notice how the Fauna docs don’t have an await before the client.query clause. client.query returns a Promise, which has a then method you can run to retrieve the results of the Promise.
Since you do include an await before the client.query clause (which is recommended), you don’t need to run then on the results - keyy should contain your results. await pauses the execution of the code and returns the resolved value without needing to run .then. So these two are equivalent:
That article I shared on async / await syntax explains this a bit more deeply. This is also a good overview of asynchronous programming in JS in general. Let me know if that helps.
Dylan Sather (Pipedream) : Yeah async / await syntax is much easier to read than the then method chaining. This stuff is hard to grok - took me years of trial and error.