Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save riccardogiorato/1f7bbcaf8b75e8c80c6c2a9c169d39c7 to your computer and use it in GitHub Desktop.
Save riccardogiorato/1f7bbcaf8b75e8c80c6c2a9c169d39c7 to your computer and use it in GitHub Desktop.
console.log("Let's run also this Node.js script!");
console.log("You can run any kind of Node.js code inside here!");
const queryGetAllUsers = "query allUsers";
const listOfUsers = graphqlRequest.query("queryGetAllUsers"); // <- call hasura endpoint
const otherFunctionLocal = require("./otherFunction");
listOfUsers.map((user) => {
fetch("alarm.vercel.app/api/check-reward?id=" + user.id); // <- run on vercel, with no "limits"
// otherFunctionLocal(user.id); // <- run on local machine
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment