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 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).

@jbolda jbolda added this to To Do in Gatsby v2 Release Mar 2, 2018
@KyleAMathews
Copy link
Contributor

@KyleAMathews KyleAMathews commented Mar 2, 2018

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.

Loading

@KyleAMathews KyleAMathews moved this from To Do to non-blocking but would be great to have in Gatsby v2 Release Mar 6, 2018
@jbolda
Copy link
Contributor Author

@jbolda jbolda commented Aug 6, 2018

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

Loading

@gatsbot
Copy link

@gatsbot 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! 💪💜

Loading

@gatsbot gatsbot bot added the stale? label Feb 7, 2019
@jbolda jbolda added not stale and removed stale? labels Feb 7, 2019
@LekoArts
Copy link
Contributor

@LekoArts LekoArts commented Jul 21, 2019

fixed by #15284

Loading

@LekoArts LekoArts closed this Jul 21, 2019
@arturhenryy
Copy link

@arturhenryy arturhenryy commented Jul 25, 2019

@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

Loading

@arturhenryy
Copy link

@arturhenryy arturhenryy commented Jul 25, 2019

How can i prevent gatsby from extracting those queries now?

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Gatsby v2 Release
  
non-blocking but would be great to have
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants