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

Added StaticQuery Explanation in Tutorial-part-4 #6915

Merged
merged 4 commits into from
Aug 7, 2018
Merged

Added StaticQuery Explanation in Tutorial-part-4 #6915

merged 4 commits into from
Aug 7, 2018

Conversation

Chuloo
Copy link
Contributor

@Chuloo Chuloo commented Jul 31, 2018

Here's a one-liner explaining the usage of StaticQuery to query data in components using GraphQL.

@KyleAMathews
Copy link
Contributor

KyleAMathews commented Jul 31, 2018

Deploy preview for using-postcss-sass failed.

Built with commit db220dd

https://app.netlify.com/sites/using-postcss-sass/deploys/5b683921c9659271652eaf08

@gatsbybot
Copy link
Collaborator

gatsbybot commented Jul 31, 2018

Deploy preview for gatsbygram ready!

Built with commit db220dd

https://deploy-preview-6915--gatsbygram.netlify.com

@gatsbybot
Copy link
Collaborator

gatsbybot commented Jul 31, 2018

Deploy preview for using-drupal ready!

Built with commit db220dd

https://deploy-preview-6915--using-drupal.netlify.com

@amberleyromo
Copy link
Contributor

@Chuloo can we add something short to this that explains more explicitly the difference between a StaticQuery and graphql query?

@Chuloo Chuloo self-assigned this Aug 1, 2018
@m-allanson
Copy link
Contributor

@amberleyromo I tried to come up with something short to add here (based on https://next.gatsbyjs.org/docs/static-query/#how-staticquery-differs-from-page-query) but found it kinda tricky to describe StaticQuery in an introductory way in a couple of lines. Which makes me wonder...

should this section of the tutorial should be rewritten to introduce StaticQuery and page queries separately? Adding them both into the same section seems like a lot to explain in one go.

The "Querying for the site title" section could be split into:

  • Make a query from your About page - this could be mostly the same content that the tutorial has now
  • Make a query from any component - this would introduce StaticQuery and how to query from any component, along with explaining the tradeoffs of using StaticQuery

Do you think it's worth opening an issue to do this?

Also note this issue that talks about ways that Gatsby could make the two different types of query easier to understand: #6596

@m-allanson
Copy link
Contributor

m-allanson commented Aug 2, 2018

Oh haha I just realised there's some related changes in #6892

@amberleyromo
Copy link
Contributor

I do think it's worth opening an issue to do this, personally. I agree that introducing them together is a lot in one go. Good to read through the issue you linked (#6596) -- What would you say the likelihood of a shift like this would be before v2 launch? (For context in prioritizing doc work).

I'm happy to run with this, if y'all want. @Chuloo @m-allanson?

@m-allanson
Copy link
Contributor

m-allanson commented Aug 6, 2018

I opened #7059 to follow up on this discussion.

What would you say the likelihood of a shift like this would be before v2 launch? (For context in prioritizing doc work).

I think this should happen before v2 release, so I marked that issue as a blocker for v2, but let's see if @shannonbux or @KyleAMathews disagree.

I'm happy to run with this, if y'all want.

Sounds great to me - although probably best to get confirmation from @shannonbux before getting started.

Copy link
Contributor

@m-allanson m-allanson left a comment

Choose a reason for hiding this comment

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

Thanks @Chuloo 👍

I updated this to include a link to the StaticQuery docs.

@KyleAMathews
Copy link
Contributor

Deploy preview for gatsbyjs failed.

Built with commit db220dd

https://app.netlify.com/sites/gatsbyjs/deploys/5b683920c9659271652eaefc

@amberleyromo
Copy link
Contributor

@m-allanson quick point of clarification:

What would you say the likelihood of a shift like this would be before v2 launch? (For context in prioritizing doc work).

I didn't mean writing the docs, I meant the potential shift described in #6596. (The new issue, #7059, addressing the docs specifically). So if that shift was going to happen before v2 goes stable, I was going to wait on those docs.

@KyleAMathews
Copy link
Contributor

#6596 def won't happen before release (if ever, needs investigating).

@m-allanson
Copy link
Contributor

I didn't mean writing the docs, I meant the potential shift described in #6596.

Ahh that makes sense, sorry for the confusion @amberleyromo.

I'm going to merge this in, and we can follow up with #7059

@m-allanson m-allanson merged commit c0e503d into gatsbyjs:master Aug 7, 2018
porfirioribeiro pushed a commit to porfirioribeiro/gatsby that referenced this pull request Aug 22, 2018
* Added StaticQuery explanation in tutorial part 4

* Added StaticQuery explanation in tutorial part 4

* Added StaticQuery explanation in tutorial part 4

* Add link to StaticQuery docs
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

Successfully merging this pull request may close these issues.

5 participants