Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching issue? #14

Closed
johnlindquist opened this issue Oct 10, 2018 · 3 comments
Closed

Caching issue? #14

johnlindquist opened this issue Oct 10, 2018 · 3 comments

Comments

@johnlindquist
Copy link

I'm trying a very basic Todo app with an airtable with fields of "text" and "done".

Running this first request from GraphiQL works great:

{
  allAirtable(filter:{table: {eq: "Todos"}}){
    edges{
      node{
        id
        data{
          text
          done
        }
      }
    }
  }
}

The above returns the result below:

{
  "data": {
    "allAirtable": {
      "edges": [
        {
          "node": {
            "id": "61a3f023-0dbe-51db-8602-dced48b86e67",
            "data": {
              "text": "eat",
              "done": null
            }
          }
        },
        {
          "node": {
            "id": "5807002b-ab6d-5eb8-9435-dcc3daa1d84e",
            "data": {
              "text": "sleep",
              "done": true
            }
          }
        },
        {
          "node": {
            "id": "390ed75e-36fa-5459-986e-b0dda9974208",
            "data": {
              "text": "code",
              "done": null
            }
          }
        }
      ]
    }
  }
}

When I update a field in airtable then make another request, I the results never change (unless I stop and restart the server). Any ideas? Thanks so much for all the time you've put into this.

@jbolda
Copy link
Owner

jbolda commented Oct 11, 2018

Unfortunately that is expected. We actually don't do any caching as Airtable.js doesn't have a concept last modification. So everytime the plugin is run, we query the whole blob and build the nodes in memory.

It also doesn't have any webhooks or sockets to my knowledge that we could subscribe to data changes. It means that polling is our only option which seemed like a lot of overhead both in code complexity and performance for something "solved" by simply restarting the server.

If you have any other ideas, I'm open to them and you're welcome 😀

@johnlindquist
Copy link
Author

No ideas from my end. Thanks for making this and taking time to respond!

@MikeBroders
Copy link

hey jbolda,

i really love your plugin and your effort in providing it.
i came to this thread because i'm also facing build issues when it comes to the gatsby build caching mechanism.
now we have 4 years later and i guess there has changed a lot in airtable.

is it possible that you can review the plugin if there are possibilities now to nicely work with the gatsby build caching?

that would a be a big step forward for your plugin because currently we can't use a very important gatsby feature.

many thanks and i'm excited to hear from you
mike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants