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

support extracted fragments in GraphiQL #14371

Closed
pieh opened this issue May 28, 2019 · 5 comments
Closed

support extracted fragments in GraphiQL #14371

pieh opened this issue May 28, 2019 · 5 comments
Assignees
Labels
topic: GraphQL Related to Gatsby's GraphQL layer

Comments

@pieh
Copy link
Contributor

pieh commented May 28, 2019

Summary

This should auto-attach extracted fragments to queries in graphiql:

  • in gatsby - we should push query from graphiql editor through relay-compiler to automatically attach fragments
  • in codemirror-graphql (set of graphql related extensions to codemirror editor that is used in graphiql) should transform query and attach fragments, so hints (autocomplete) and lint (red underline on unknown identifiers) make use of gatsby fragments - I opened issue in codemirror-graphql that would add support for this - https://github.com/graphql/codemirror-graphql/issues/260 , which would be nicest way forward, but if this won't be accepted we can fork it to add this feature
  • (nice to have, but not necessary) adjust graphql-language-service-interface to show fragment spread earlier so they can be discovered much easier ( https://github.com/graphql/graphql-language-service/issues/358 )

Basic example

I've made proof of concept that involved lot of monkey patching with very nice result:
Screenshot 2019-05-25 at 18 48 05
(see code changes master...pieh:graphiql-explorer-fragments )
This would need to be cleaned up, ideally changes applied in upstream packages if possible, to reduce hackiness needed to implement this in Gatsby GraphiQL editor

Motivation

This is common pain point, that queries that work in page/static queries that use fragments don't work in graphiql. Goal here is to widen support for fragments and lower friction.

@pieh pieh changed the title support fragments on GraphiQL support extracted fragments in GraphiQL May 28, 2019
@janosh
Copy link
Contributor

janosh commented May 30, 2019

Would love to have this feature!

@pieh pieh self-assigned this Jun 4, 2019
@gatsbot
Copy link

gatsbot bot commented Jun 25, 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!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contributefor more information about opening PRs, triaging issues, and contributing!

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 Jun 25, 2019
@m-allanson m-allanson added not stale and removed stale? Issue that may be closed soon due to the original author not responding any more. labels Jun 26, 2019
@lannonbr lannonbr added the topic: GraphQL Related to Gatsby's GraphQL layer label Aug 14, 2019
@refactorized
Copy link

I am surprised this doesn't have more traction. The lack of fragments in graphiql leaves a pretty big hole in my workflow.

@speedhawk21
Copy link

Any reason why fragments are not supported yet? This is such a bother when testing queries in graphiql.

@LekoArts
Copy link
Contributor

Fixed with #28878

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: GraphQL Related to Gatsby's GraphQL layer
Projects
None yet
Development

No branches or pull requests

8 participants