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

fix(gatsby): remove redundant dispatch of query extraction error #28676

Merged
merged 2 commits into from
Dec 17, 2020

Conversation

vladar
Copy link
Contributor

@vladar vladar commented Dec 17, 2020

Description

This PR fixes a bug where we incorrectly mark a component as having a query extraction error. Very edge case, pretty well explained in the test case:

This is a regression test for query extraction bug in Gatsby.

All of the following is required to hit this bug:

1. `gatsby-plugin-mdx` should be installed + at least one other plugin implementing `preprocessSource`
2. This plugin must be listed before `gatsby-plugin-mdx` in `gatsby-config.js`
3. MDX file must contain the word `graphql`

MDX is not requirement - any two plugins implementing preprocessSource could hit this. But it was easier to reproduce and write a test case with mdx.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 17, 2020
pieh
pieh previously approved these changes Dec 17, 2020
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all - "wat"
Secondly - well found ;) LGTM, have one not blocking comment - up to you if you think it needs addressing or not

e2e-tests/mdx/src/pages/regressions/index.mdx Show resolved Hide resolved
@vladar vladar added topic: StaticQuery and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Dec 17, 2020
@pieh pieh added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Dec 17, 2020
@gatsbybot gatsbybot merged commit 1d7dc76 into master Dec 17, 2020
@gatsbybot gatsbybot deleted the vladar/fix-extraction-error branch December 17, 2020 20:45
vladar added a commit that referenced this pull request Dec 23, 2020
)

* fix(gatsby): remove redundant query extraction error dispatch

* Warning message

(cherry picked from commit 1d7dc76)
vladar added a commit that referenced this pull request Dec 23, 2020
) (#28744)

* fix(gatsby): remove redundant query extraction error dispatch

* Warning message

(cherry picked from commit 1d7dc76)

Co-authored-by: Vladimir Razuvaev <[email protected]>
@vladar
Copy link
Contributor Author

vladar commented Dec 23, 2020

Published in [email protected]

pragmaticpat pushed a commit to pragmaticpat/gatsby that referenced this pull request Apr 28, 2022
…sbyjs#28676)

* fix(gatsby): remove redundant query extraction error dispatch

* Warning message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants