Skip to content

Loading (Static Query) #6350

@rockchalkwushock

Description

@rockchalkwushock

Description

When using the new <StaticQuery /> api I am continually receiving the Loading (Static Query) message.

Steps to reproduce

// layout.js

const Layout = ({ children }) => <div>{children}</div>
// HomePage.js

export default () => (
  <Layout>
     <StaticQuery
       query={graphql`
         query HomePage {
           site {
             siteMetadata {
               author
             }
           }
         }`
        }
        render={data => <h1>{data.site.siteMetadata.author}</h1>}
     />
  </Layout>
)
// gatsby-config.js

module.exports = {
  siteMetadata: {
    author: 'Cody Brunner'
  }
}

Expected result

I would expect an h1 to be returned with my name in the browser.

Actual result

I received Loading (Static Query)

Environment

  System:
    OS: macOS High Sierra 10.13.5
    CPU: x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 8.11.1 - ~/.nvm/versions/node/v8.11.1/bin/node
    Yarn: 1.7.0 - /usr/local/bin/yarn
    npm: 6.0.0 - ~/.nvm/versions/node/v8.11.1/bin/npm
  Browsers:
    Chrome: 67.0.3396.99
    Firefox: 61.0
    Safari: 11.1.1
  npmPackages:
    gatsby: ^2.0.0-beta.19 => 2.0.0-beta.19

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedIssue with a clear description that the community can help with.type: bugAn issue or pull request relating to a bug in Gatsby

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions