Create a headless Node.js custom app

Shopify Partner
7 0 0

I am learning Shopify app development, and I got my first gig from a friend!

In short, I need to make an app that on a regular schedule, would access an FTP server and download a list containing product SKU to which I should update the quantity, then using the GraphQL API I would update the products I need.

Currently, I created a Node.js app using the Shopify-CLI.

So far so good, however, I am not sure about a few parts of this app:

- Since I need to schedule operations using something like this how can I authenticate every time my `ApolloClient`? `ApolloClient`, to instantiate needs `shop` and `accessToken`, which normally come from the request cookie, however in my case, "I should have them available any moment" in order to run my logic on schedule.

- I found a very well written documentation regarding the Node.js + React part, however, I am missing something regarding the backend logic. Where can I find more documentation regarding my use case?

- The CLI creates already backend code to instantiate the client:


export const createClient = (shop, accessToken) => {
  return new ApolloClient({
    uri: `https://${shop}/admin/api/2019-10/graphql.json`,
    request: (operation) => {
        headers: {
          "X-Shopify-Access-Token": accessToken,
          "User-Agent": `shopify-app-node ${process.env.npm_package_version} | Shopify App CLI`,


Hence, it seems to me that this use case has already been tackled somehow. However, I have some troubles understand how can I leverage this boilerplate code in my case.

- There might be a chance this is not a good use case of the Shopify CLI, and my approach is completely wrong. What do you suggest would be a better approach for this app?

Sorry for the long post, and thanks in advance anyone