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

pieh opened this issue May 28, 2019 · 1 comment


3 participants
Copy link

commented May 28, 2019


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 - , 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 ( graphql/graphql-language-service#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


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

@pieh pieh added this to To prioritize in OSS Roadmap via automation May 28, 2019

@pieh pieh added the effort: med label May 28, 2019

@m-allanson m-allanson moved this from To prioritize to Prioritized in OSS Roadmap May 29, 2019


This comment has been minimized.

Copy link

commented May 30, 2019

Would love to have this feature!

@pieh pieh moved this from Prioritized to In progress in OSS Roadmap Jun 4, 2019

@pieh pieh self-assigned this Jun 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.