Git Product home page Git Product logo

Comments (5)

eunjae-lee avatar eunjae-lee commented on September 24, 2024 3

Sure. I'll try to work on it in a couple of days. Ah, by the way, happy new year πŸŽ‰

from gatsby-source-airtable.

jbolda avatar jbolda commented on September 24, 2024

πŸ‘‹

So I believe there are two layers of issues here. First it is Airtable not delivering all of the expected fields (which when Gatsby infers your data structure causes errors). Your proposition is to fix this. Secondly we have the ongoing issue with Gatsby inferring your data structure in a manner you don't expect/want. Couple other (I believe) relevant issues below:

Obviously we aren't going to fix the second consideration here, but it's looking like the solution might be similar to your thoughts for the first consideration. I'm thinking we may not want to try to implement a list of fields as that might step on the toes Gatsby core's eventual solution. However, maybe we can adjust our solution slightly to something that would always be useful for this plugin. What if we instead of fields have an optional object defaultValues that just gets merged with each Airtable row prior to mapping and node creation? You would be able to literally add fields that don't exist in Airtable this way, and we don't need to try to decide a sensible default / null for the user. (I believe, but don't quote me, that the graphql infer skips/ignores nulls anyways.) What do you think of this approach? Usable in the long run, and fixes your issue in the short term.

from gatsby-source-airtable.

eunjae-lee avatar eunjae-lee commented on September 24, 2024

Firstly, it's Airtable's decision not to fill all the fields when their values are null and it's pretty common situation. So we cannot do anything about it.
Secondly, as soon(?) as gatsby fix those issue, this fix will be useless.

So as you suggest, defaultValues sounds a good way to cover this problem and also provides something useful to other users as well. And actually that's a better fix than my previous suggestion because all fields might have different default values.

from gatsby-source-airtable.

jbolda avatar jbolda commented on September 24, 2024

Firstly, it's Airtable's decision not to fill all the fields when their values are null and it's pretty common situation. So we cannot do anything about it.

Agreed as well. (I didn't make that clear in my previous comment.)

Sounds perfect to me. Would you be available to work on a PR for this?

from gatsby-source-airtable.

jbolda avatar jbolda commented on September 24, 2024

Great! Thanks again for the help, and happy new year to you as well!

from gatsby-source-airtable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.