Querying Global fields using CraftQL and Gatsby JS I am using Craft in headless mode with the CraftQL plugin. My front end is built using Gatsby JS.

I am able to query entries and output the data to my templates, however Global fields are not available. Here is my code:

// gatsby-config.js
plugins: [
  {
        resolve: `gatsby-source-craftcms`,
        options: {
            endpoint: `http://cms.local/api`,
            token: `REDACTED`,
            query: `{
                globals: globals {
                    contact {
                        address
                    }
                },
                home: entries(section:[home]) {
                    id
                    title
                    ... on Home {
                        subHeading
                        intro
                        ctaButton {
                            ... on CtaButtonButton {
                                __typename
                                text
                                linkUrl
                            }
                        }
                    }
                },
// etc


And then in my template:

export const query = graphql`
  query {
    home {
        title
        subHeading
        intro
        ctaButton {
            text
            linkUrl
        }
    }
    globals {
        contact {
            address
        }
    }
  }
`


In my console I get:

error  Cannot query field "globals" on type "Query"


If I remove the globals from the query I can successfully build and output data.home.title.

I've tried using the CraftQL browser in the CMS and I can successfully query globals:

 

I'm confident I'm missing something but can find nothing in the docs for Gatsby-Source-Craft or CraftQL. 

Anyone have any idea what I'm doing wrong here??
In looking at this, the first thing I notice is that your query has a field called globals, but your error has the singular global.

If you open Gatsby’s GraphiQL instance (http://localhost/8000/___graphql in develop mode), can you see the Craft CMS data in the docs? That might help zero in on the query to use in Gatsby.

Hope that helps!