Comments (5)
Sure. I'll try to work on it in a couple of days. Ah, by the way, happy new year π
from gatsby-source-airtable.
π
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.
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.
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.
Great! Thanks again for the help, and happy new year to you as well!
from gatsby-source-airtable.
Related Issues (20)
- Gatsby v3 DeprecationWarning HOT 4
- Combining fileNode and text/markdown mappings HOT 3
- faster build when sourcing a lot of data HOT 2
- getting base name in graphql
- Field type mismatch in Airtable means field doesn't show up at all in Gatsby HOT 1
- Query on Collaborator type does not recognise the profilePicUrl
- is it possible to filter by a field in a Linked Table? HOT 1
- Dependency Dashboard
- Slow build times HOT 1
- Mp3 files get converted to Mpga HOT 3
- Unused variable `nodeType`
- Can this plugin be used to link lookup fields instead of linked records?
- How do add default tableLinks?
- update for Gatsby V4
- base name issue in Airtable?
- Upcoming updates to Airtable Attachment URLs that are fetched via API HOT 8
- error Cannot read properties of undefined (reading 'id')
- Early heads up: switching away from user API keys HOT 1
- Accelerated need to limit large url requests to βlist recordsβ, with alternative POST version HOT 5
- Build take alot of time.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-source-airtable.