Git Product home page Git Product logo

Comments (9)

brandonweiss avatar brandonweiss commented on September 24, 2024 1

Ah, that makes sense! Thanks for your help!

from gatsby-source-airtable.

jbolda avatar jbolda commented on September 24, 2024

What we do here is create a new node that ties this field to that new file node that is created. You may just need to restart the gatsby develop if you haven't. I don't think this will rebuild itself save (e.g. hot reloading).

You will likely go from a node that mirrors the JSON data Airtable would send like below:
image

to a node with a localFiles:
image

The localFiles will contain that file node that you are seeing in your query of allAirtableField. My assumptions may very well be wrong, but please let me know if this helps.

from gatsby-source-airtable.

brandonweiss avatar brandonweiss commented on September 24, 2024

Hmm, I don’t seem to have a localFiles field 🤔

I dug through the code and I can see that there is a conditional where you check if there are any local files before creating that field.

But I just traced it through and the localFiles___NODE property is getting set to an array containing the node’s ID. So it seems like it should work… 🤔

from gatsby-source-airtable.

jbolda avatar jbolda commented on September 24, 2024

Hmm, part of me wonders if it is specifically an issue with a svg? I see your example using it.

from gatsby-source-airtable.

brandonweiss avatar brandonweiss commented on September 24, 2024

Or wait, I think I misunderstood. What I was looking at is the new node for the “AirtableField” being created? But when I look at processedData in checkChildNode, I can see that it has the link:

{
  logo___NODE: '16f22541-3d66-5a9f-902d-7215f455e333'
}

It seems like it should work?

from gatsby-source-airtable.

brandonweiss avatar brandonweiss commented on September 24, 2024

Ach, I misunderstood on what node the localFiles field was supposed to be. Sorry, I’m a bit new to Gatsby, let me start over.

The AirtableField is all good. I can see the localFiles property. That node appears to be fine. The problem is what I originally thought. The logo field that should be linked to the AirtableField node just isn’t there for some reason.

from gatsby-source-airtable.

brandonweiss avatar brandonweiss commented on September 24, 2024

Hmm, maybe I found the problem?

processedData is passed into checkChildNode here:

let checkedChildNode = checkChildNode(key, row, processedData, {

processedData is mutated to create the link here:

processedData[`${cleanedKey}___NODE`] = createNodeId(
`AirtableField_${row.id}_${cleanedKey}`
);

But if you step back out of that function, processedData doesn’t seem to have been mutated. When I inspect it here:

return { data: processedData, childNodes: childNodes };

It doesn’t have the logo___NODE property.

from gatsby-source-airtable.

brandonweiss avatar brandonweiss commented on September 24, 2024

FML. I updated some seemingly unrelated packages (gatsby-image, gatsby-plugin-sharp, and gatsby-transformer-sharp) and now it works 🙄

from gatsby-source-airtable.

jbolda avatar jbolda commented on September 24, 2024

There is some async/promise things going on which may explain why your log didn't see it mutated. We only mutate locally to "build" up the data on the node, and when that is complete we use it to create the node.

Well, I am glad that you figured it out at least. It seems that upstream has been having a few issues and eating the true error, then giving us unhelpful remains.

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.