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

docs: Add a note about gatsby-image fragments not working in GraphiQL #25387

Merged
merged 5 commits into from
Jul 9, 2020

Conversation

MarkBennett
Copy link
Contributor

This is a known issue, but it could confuse new Gatsby users (like myself).

See the gatsby-image docs for details, and this GraphiQL issue for progress on a fix.

Description

Add a note about gatsby-image query fragments not working in GraphiQL.

Documentation

This is a documentation change.

Related Issues

This is a known issue, but it could confuse new Gatsby users (like myself).

[See the `gatsby-image` docs for details](https://www.gatsbyjs.org/packages/gatsby-image/#fragments), and [this GraphiQL issue for progress on a fix](graphql/graphiql#612).
@MarkBennett MarkBennett requested a review from a team as a code owner June 29, 2020 16:40
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 29, 2020
@MarkBennett MarkBennett changed the title Add a note about queries not working in GraphiQL Add a note about gatsby-image fragments not working in GraphiQL Jun 29, 2020
@acao
Copy link
Contributor

acao commented Jun 29, 2020

hey @MarkBennett ! good point. I'm the primary maintainer for graphiql and a gatsby employee, and this is one of the issues we plan on solving with graphiql@2 and our upcoming gatsby graphiql preset

what might be a better fix for the documentation is to include the fragment that needs to be included in the graphiql query. these shared fragments are actually appended to the user queries defined at runtime, so that abstraction is why it doesn't work in graphiql currently.

@MarkBennett
Copy link
Contributor Author

Thanks for the quick reply!

That would be great, as I'd very much like to use the fragments in my queries as well.

How might I include them? I'll update the docs but don't know myself. 😉

@acao
Copy link
Contributor

acao commented Jun 29, 2020

to note, gatsby image contains docs that warns these queries won't work in GraphiQL here
https://www.gatsbyjs.org/packages/gatsby-image/#fragments

because these fragments are generated on the fly, unlike the static ones used in some plugins, I actually don't think there is a way to use these in GraphiQL yet, without being able to describe the entire fragment

@MarkBennett
Copy link
Contributor Author

to note, gatsby image contains docs that warns these queries won't work in GraphiQL here

Yes. That's my understanding as well. I've linked to those in my note about why the queries in the tutorial won't work in GraphiQL.

I'm mostly thinking including a note near the first query would help new learners undertand about the fragments, as right now there's just an error and it's unclear if it's expected or not.

@acao acao added bot: merge on green Gatsbot will merge these PRs automatically when all tests passes status: needs docs review Pull request related to documentation waiting for review and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jun 29, 2020
@acao
Copy link
Contributor

acao commented Jun 29, 2020

@MarkBennett oh of course, yes this makes sense. Thanks for the PR :D

Some nice improvements to this coming soon!

@MarkBennett
Copy link
Contributor Author

Thanks! It looks like I'm failing on your CI, but I can't see the linter output.

Will look closer when I'm at my computer.

@ascorbic ascorbic added bot: merge on green Gatsbot will merge these PRs automatically when all tests passes and removed bot: merge on green Gatsbot will merge these PRs automatically when all tests passes labels Jul 1, 2020
@wardpeet wardpeet added type: documentation An issue or pull request for improving or updating Gatsby's documentation and removed bot: merge on green Gatsbot will merge these PRs automatically when all tests passes labels Jul 3, 2020
@wardpeet wardpeet changed the title Add a note about gatsby-image fragments not working in GraphiQL docs: Add a note about gatsby-image fragments not working in GraphiQL Jul 3, 2020
Copy link

@AishaBlake AishaBlake left a comment

Choose a reason for hiding this comment

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

Looks good! I'm excited for the changes Rikki mentioned but adding this line to the tutorial should be helpful. Thanks for the contribution, @MarkBennett!

@AishaBlake AishaBlake removed the status: needs docs review Pull request related to documentation waiting for review label Jul 9, 2020
@AishaBlake AishaBlake merged commit c6593b9 into gatsbyjs:master Jul 9, 2020
@gatsbot
Copy link

gatsbot bot commented Jul 9, 2020

Holy buckets, @MarkBennett — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. We’ve got Gatsby t-shirts, stickers, hats, scrunchies, and much more. (You can also unlock even more free swag with 5 contributions — wink wink nudge nudge.) See gatsby.dev/swag for details.
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

pragmaticpat pushed a commit to pragmaticpat/gatsby that referenced this pull request Apr 28, 2022
…QL (gatsbyjs#25387)

* Add a note about queries not working in GraphiQL

This is a known issue, but it could confuse new Gatsby users (like myself).

[See the `gatsby-image` docs for details](https://www.gatsbyjs.org/packages/gatsby-image/#fragments), and [this GraphiQL issue for progress on a fix](graphql/graphiql#612).

* chore: format

* Update docs/tutorial/gatsby-image-tutorial/index.md

Co-authored-by: Yogi <[email protected]>

* Fix relative link

Co-authored-by: gatsbybot <[email protected]>
Co-authored-by: Ward Peeters <[email protected]>
Co-authored-by: Yogi <[email protected]>
Co-authored-by: Aisha Blake <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation An issue or pull request for improving or updating Gatsby's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants