Code Monkey home page Code Monkey logo

Comments (4)

frederickfogerty avatar frederickfogerty commented on June 17, 2024

Hi @calebfaruki, thanks for opening this issue 🙌 I appreciate the critique here, and I can understand your frustration. I just wondered if you had any concrete suggestions for (1) to improve its intuitiveness? For (2), I'm not quite fully understanding your suggestion, could you please elaborate on it?

from gatsby.

calebfaruki avatar calebfaruki commented on June 17, 2024

For point one, there should be better documentation. The examples are okay. But it's better to know what each field is doing and how to determine what value to put there.

---
templateKey: category-page
path: /path/to/page
title: My Category Page
heroImage:
  imageKey: MyImage.jpg # https://myhost.imgix.net/MyImage.jpg
  # fieldName value will be inserted by gatsby config.
  # Will have return value of GatsbyImageLike (see Typescript definition)
---

Here's my raw text

Corresponding gatsby configuration for custom field.

{
  // get the __typename value from parent node where the imgix data will be nested.
  nodeType: 'MarkdownRemarkFrontmatterHeroImage',
  // what is the adjacent field/resolver for creating referencing the image asset at the URL.
  getURL: (node) => node.imageKey,
  // this is the name of the field that is created within the parent node specified in nodeType
  fieldName: 'imgixImage',
},

Regarding point number two, the best fundamental thing would be for the getURL error to give expected versus actual output.

If it errs on a markdown content entry, it should say what the value is, which piece of content it failed on, and what it would expect the result to look like. An example accompanying the expected data type would also help contextualize the hint.

Error when resolving URL value for node type MarkdownRemarkFrontmatterMyCustomNode. This probably means that the getURL function in
gatsby-config.js is incorrectly set. Please read this project's README for detailed instructions on how to set this correctly.

For the following query:
query {
  MyCategoryPages {
    heroImage {
      imgixImage
    }
  }
}

Expected: File name.
Actual: <whatever value getURL is actually returning>

from gatsby.

frederickfogerty avatar frederickfogerty commented on June 17, 2024

Thanks for the extra suggestions here @calebfaruki! I will raise this with my team and see if we can prioritise updating these. Of course, a PR here is also welcome and I will be prompt with reviews and feedback. Let me know if this is something you are interested in.

from gatsby.

luqven avatar luqven commented on June 17, 2024

Hey @calebfaruki,

I wanted to take a second to follow up on this. We agree it would be nice to have better-debugging features but don't have the bandwidth to tackle this just yet.

I'm going to leave this issue open and in the meantime encourage folks who are interested in seeing this added to comment and react on this post. This will help us prioritize this work next time we review outstanding tasks.

As always, a PR is also welcome and we'll be sure to provide guidance and feedback.

Thanks again for opening this issue and we'll comment on this issue whenever there's been a change in status.

from gatsby.

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.