Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL query for markdown excerpt not working within component. #3252

Closed
Jaikant opened this issue Dec 17, 2017 · 2 comments
Closed

GraphQL query for markdown excerpt not working within component. #3252

Jaikant opened this issue Dec 17, 2017 · 2 comments

Comments

@Jaikant
Copy link
Contributor

Jaikant commented Dec 17, 2017

Description

Issue with Markdown excerpts.
The graphql query from within the react component to fetch the prune length seems to be working intermittently. Whereas the query from localhost:8000/___graphql works perfectly fine.

I had seen a similar issue earlier, when the query within the component behaved weirdly due to other problems with the code, for some reason that would also manifest itself on the graphQL query within the component.

This time, I am pretty sure there are no issues in my code. I did a gatsby clean, yet the query from within the component does not seem to be getting refreshed. A query directly from localhost:8000/___graphql works allright.

Any pointers on what could be wrong, as anyone faced similar issues? Do need to clean my node_modules and re-install? I would prefer not doing that.

@Jaikant
Copy link
Contributor Author

Jaikant commented Dec 17, 2017

I tried to add additional fields into the query and those fields are not getting queried. Whereas the same fields get queried successfully from localhost:8000/___graphql.
So I am pretty sure, the graphQL query is failing somewhere within the component. How do we debug this, as there is no error message being displayed?

@Jaikant
Copy link
Contributor Author

Jaikant commented Dec 17, 2017

Ok. This is embarassing. The problem was it was a template component and the query within the file was a leftover, before I turned the component into a template. I updated the query in the gatsby-node.js and it worked ever so smoothly!

@Jaikant Jaikant closed this as completed Dec 17, 2017
This was referenced Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant