Creating a worker
You can create your workers from scratch using the Graphql schema. Or you can use the few utilities functions available to quickly setup a worker.
checkForJobs()
// Create an ApolloClient that uses your endpoint url
// Here it is using the default url provided by the out-of-the-box server
const client = New ApolloClient({uri : 'http://localhost:8080/graphql'})
const job = await checkForJobs({
typeList: ['myJobType'],
client,
processingFunction: async (job) => {
const result = await myApiCall()
return myProcessingFunction(result)
}
})Easy debug without looping
Facilities
updateProcessingInfo()
Avoiding spamming your API
Identifying workers
Last updated