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

Update react-helmet syntax to new simplified API #1919

Merged
merged 1 commit into from
Aug 28, 2017

Conversation

markmichon
Copy link
Contributor

Closes #1906. Converts most examples, as well as the gatsbyjs.org site source to use the new simplified api in react-helmet. One notable exception being the examples/using-javascript-transforms files, as the example fails to run and probably deserves it's own PR with some updates.

@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit bbd9dea

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

@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit bbd9dea

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

@jbolda
Copy link
Contributor

jbolda commented Aug 26, 2017

Do you have an error output for examples/using-javascript-transforms?

@markmichon
Copy link
Contributor Author

markmichon commented Aug 26, 2017

@jbolda sure thing, it has to do with the query in the index layout.

GraphQL Error Unknown field `allSite` on type `RootQueryType`

  file: /Users/markmichon/_dev/gatsby/examples/using-javascript-transforms/src/layouts/index.js

   1 | 
   2 |   query LayoutBySlug {
>  3 |     allSite {
     |     ^
   4 |       edges {
   5 |         node {
   6 |           siteMetadata {
   7 |             title
   8 |             siteDescr
   9 |             siteAuthor
  10 |             siteEmailUrl
  11 |             siteEmailPretty
  12 |             siteTwitterUrl
  13 |             siteTwitterPretty

The fix is pretty straightforward, changing the above query into:

query LayoutBySlug {
    site {
          siteMetadata {
            title
            siteDescr
            siteAuthor
            siteEmailUrl
            siteEmailPretty
            siteTwitterUrl
            siteTwitterPretty
          }
        }
      }

Then adjusting some of the variable declarations in the file. I can put together a PR specifically for that, with the inclusion of the helmet changes. It looked like a good portion was still WIP so I didn't want to get in the way.

@jbolda
Copy link
Contributor

jbolda commented Aug 26, 2017

It's... as finished as it can be pending #1895. This is issue fixed already in that PR. Might have been good to separate it into another PR though. I haven't and didn't plan to update react-helmet as part of that PR though. Whatever you think is best. I just wanted to make sure it wasn't something else I missed.

@markmichon
Copy link
Contributor Author

Ah, I see. Makes sense. I'll leave it out of this PR and adjust down the road once it makes it's way into master.

@KyleAMathews
Copy link
Contributor

@jbolda allSite was removed recently as there can only be one Site node so the allSite was meaningless. Probably should have waited for a major release for that…

@KyleAMathews
Copy link
Contributor

Nice! Love the new syntax. Thanks for fixing things up!

@KyleAMathews KyleAMathews merged commit d0e8fc0 into gatsbyjs:master Aug 28, 2017
@jlengstorf
Copy link
Contributor

Hiya @markmichon! 👋

This is definitely late, but on behalf of the entire Gatsby community, I wanted to say thank you for being here.

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 t-shirts and hats, plus some socks that are really razzing our berries right now.)
  2. If you’re not already part of it, we just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. You’ll receive an email shortly asking you to confirm. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If you have questions, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again! 💪💜

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