Comments (4)
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.
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.
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.
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)
- Use multiple sources within the same project HOT 3
- Building schema failed: Type `<type name>` declared in `createTypes` looks like a node, but doesn't implement a `Node` interface HOT 10
- Unable to provide the right src to ImgixGatsbyImage and fetching images: error 403. HOT 6
- getGatsbyImageData() returns larger images than needed in scrSet HOT 1
- Gatsby v4 compatibility HOT 26
- AVIF format not showing HOT 4
- Type Definition for "TRACED_SVG" Missing HOT 1
- feat: gracefully handle empty image URL fields HOT 5
- Js-core being exported in production as 57.7kb HOT 3
- Version 2.0.1 broken NPM package, missing dist/ folder HOT 2
- Is it possible to sign URLs when using the `getGatsbyImageData` hook? HOT 3
- feat: support for images within markdown HOT 2
- deprecated [email protected] dependency HOT 1
- `disableIxlibParam` doesn't work HOT 4
- Gatsby V5 support - graphql dependency HOT 3
- fix: Invalid plugin options for "@imgix/gatsby" - "domain" is required HOT 5
- fix: no support for `gatsby-plugin-image@3` so no `gatsby@5` support HOT 6
- ERROR @imgix/gatsby not working at all at build proccess HOT 3
- Is it possible to use customized GraphQL fields?
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.