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

[v2] Support Graphql queries in npm package / node_modules #4322

Closed
jbolda opened this issue Mar 2, 2018 · 6 comments
Closed

[v2] Support Graphql queries in npm package / node_modules #4322

jbolda opened this issue Mar 2, 2018 · 6 comments

Comments

@jbolda
Copy link
Contributor

jbolda commented Mar 2, 2018

As another layer of abstraction, it would be great to support templates and/or graphql fragments in npm packages as originally noted here in #2662 . This would require extracting graphql queries from node_modules. The low hanging fruit is to support extracting queries from any "components" specified in createPage, but eventually supporting fragments would be nice as well.

Tangentially related is that gatsby would need to babel templates as well to deal with the graphql queries nicely. This is already planned in #3870 5).

@KyleAMathews
Copy link
Contributor

I think this is a great idea! We'd need to evaluate how to do this in a performant way but it seems doable. I'm not going to make this a blocker for v2's release (it can go in at any time since it's not a breaking change) but would love someone to investigate the implications of doing this & make a PR if they'd like.

@jbolda
Copy link
Contributor Author

jbolda commented Aug 6, 2018

Point 5) in #3870 moved to #7064 it seems for anyone following along.

@gatsbot
Copy link

gatsbot bot commented Feb 7, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Feb 7, 2019
@jbolda jbolda added not stale and removed stale? Issue that may be closed soon due to the original author not responding any more. labels Feb 7, 2019
@LekoArts
Copy link
Contributor

fixed by #15284

@arturhenryy
Copy link

@LekoArts not 100% sure but i think this broke my app. I use the plugin gatsby-plugin-mailchimp and in there are two example folders for the implementation of the plugin in v1 and v2. both have a file where they use a query named SiteTitleQuery. And since a few days my app does throw a error during build and dev:

There was an error in your GraphQL query:

Error: RelayParser: Encountered duplicate defintitions for one or more documents: each document must have a unique name. Duplicated documents:

SiteTitleQuery

@arturhenryy
Copy link

How can i prevent gatsby from extracting those queries now?

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

4 participants