Gatsby-theme-novela: Not able to use shadowing on data.query.js file

Created on 3 Oct 2019  路  22Comments  路  Source: narative/gatsby-theme-novela

I am trying to shadow the data.query.js file to get the desired output. But it's not working. Can you please help @ChristopherBiscardi

Most helpful comment

All 22 comments

@nnnkit could you link me to the repo you're working in? It's possible you have an incorrect path that's causing shadowing to fail.

Hi @brotzky, I have the same problem, can you check my src folder to see if I am doing right the shadowing of the data.query.js file?

Screenshot from 2019-10-10 10-37-52

That looks like the correct shadowing. This might actually be a bug within Gatsby Theme's Component Shadowing itself.

I am assuming you're exporting correcting from data.query.js?

Correct path:
http://d.ntve.co/JI4fM0

Sorry for the late response.

Yes @brotzky, i just copy the data.query.js file from the source, and just did my modification, and then run yarn clean && yarn dev.

But I don't get it to work, do you have any idea way?

Here is the export part.

Screenshot from 2019-10-15 12-47-35

@brotzky I was reading about shadowing, and it sames that we only can shadow files in the src folder, and since the data.query.js file is outside of the src its no going to work.

Is there another way to modify the data.query.js file or a way to change the format and locale of the published date of the articles?

That's my end goal, change the format and locale of the published date of the articles.

I can move it into the src file if that's an easy win.

I think that's a better approach then somehow making it configurable without shadowing.

I think that's a better approach then somehow making it configurable without shadowing.

I think the same, that would be a win.

I can move it into the src file if that's an easy win.

Do you need any help @brotzky?

If you'd like to PR it that would be awesome :)

Awesome i'm on it. :+1:

Hey @brotzky I just send the PR #176 take a look.

Hi @wilmanbarrios has the merged PR fixed this?

I'm trying to do the same as you and update the date format. When i try and shadow the data.query.js file in the same folder you have it on as on your screenshot, still nothing happens even after i do a gatsby build/develop

Any ideas?

@jmigdelacruz no dude.

I ended doing a shadowing of the component that render the published date and then applied my custom format based on the the format of the date that is coming from GraphQL.

I think that is something with the path resolution in the theme itself, but i'm not sure.

Hmmm, im not entirely sure as well. Shadowing is a bit of a blackbox when it doesn't work properly so it's hard for me to fix it.

Looking forward to that PR, thanks.

The PR just got merged. But still changing the graphQL query not work.

Maybe we also have to update Novela's Gatsby version?

I'm not sure, but we could try and see it works.

Any update on this?

Any update?

@aabosh and @luisarbezerra you're both welcome to fix it yourselves and submit a PR 鉂わ笍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jorgeorejas picture jorgeorejas  路  3Comments

brotzky picture brotzky  路  4Comments

bravo-kernel picture bravo-kernel  路  4Comments

sw-yx picture sw-yx  路  3Comments

dgovil picture dgovil  路  3Comments