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

-warn- Multiple node fields resolve to the same GraphQL field #19491

Closed
MauriceOppenberger opened this issue Nov 13, 2019 · 29 comments
Closed

-warn- Multiple node fields resolve to the same GraphQL field #19491

MauriceOppenberger opened this issue Nov 13, 2019 · 29 comments
Labels
type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@MauriceOppenberger
Copy link

MauriceOppenberger commented Nov 13, 2019

might be banal but I am getting this error message when compiling and deploying by gatsby site. That site is still being built but I can't figure out what causes the error message

Message ---
warn Multiple node fields resolve to the same GraphQL field wordpress__acf_pages.acf.landingbackground - [landingbackground, landingbackground___NODE]. Gatsby will use
landingbackground___NODE.
warn Multiple node fields resolve to the same GraphQL field wordpress__acf_pages.acf.contactbackground - [contactbackground, contactbackground___NODE]. Gatsby will use
contactbackground___NODE.
warn Multiple node fields resolve to the same GraphQL field wordpress__acf_pages.acf.exterioricon - [exterioricon, exterioricon___NODE]. Gatsby will use exterioricon___NODE.
warn Multiple node fields resolve to the same GraphQL field wordpress__acf_pages.acf.interioricon - [interioricon, interioricon___NODE]. Gatsby will use interioricon___NODE.
warn Multiple node fields resolve to the same GraphQL field wordpress__acf_pages.acf.additionalicon - [additionalicon, additionalicon___NODE]. Gatsby will use
warn Multiple node fields resolve to the same GraphQL field wordpress__PAGE.acf.landingbackground - [landingbackground, landingbackground___NODE]. Gatsby will use
landingbackground___NODE.
warn Multiple node fields resolve to the same GraphQL field wordpress__PAGE.acf.contactbackground - [contactbackground, contactbackground___NODE]. Gatsby will use
contactbackground___NODE.
warn Multiple node fields resolve to the same GraphQL field wordpress__PAGE.acf.exterioricon - [exterioricon, exterioricon___NODE]. Gatsby will use exterioricon___NODE.
warn Multiple node fields resolve to the same GraphQL field wordpress__PAGE.acf.interioricon - [interioricon, interioricon___NODE]. Gatsby will use interioricon___NODE.
warn Multiple node fields resolve to the same GraphQL field wordpress__PAGE.acf.additionalicon - [additionalicon, additionalicon___NODE]. Gatsby will use additionalicon___NODE.
warn Multiple node fields resolve to the same GraphQL field wordpress__wp_media.guid - [guid___NODE, guid]. Gatsby will use guid___NODE.

my query---

query HomePageQuery {
wordpressPage(title: { eq: "Homepage" }) {
acf {
landingbackground {
localFile {
url
childImageSharp {
fluid(quality: 100, maxWidth: 2000) {
...GatsbyImageSharpFluid_withWebp
src
}
}
}
}
contactbackground {
localFile {
url
childImageSharp {
fluid(quality: 100, maxWidth: 1800) {
...GatsbyImageSharpFluid_withWebp
src
}
}
}
}
exterioricon {
localFile {
url
}
}
interioricon {
localFile {
url
}
}
additionalicon {
localFile {
url
}
}
}
}
}

any suggestions?

Summary

Relevant information

Environment (if relevant)

File contents (if changed)

gatsby-config.js: N/A
package.json: N/A
gatsby-node.js: N/A
gatsby-browser.js: N/A
gatsby-ssr.js: N/A

@LekoArts LekoArts added the type: question or discussion Issue discussing or asking a question about Gatsby label Nov 18, 2019
@LekoArts
Copy link
Contributor

Thank you for opening this!

These warnings can sometimes occur in certain situations with the wordpress source plugin but they shouldn't cause any troubles. So for now: Save to ignore.

If you want you can try WPGraphQL: https://www.wpgraphql.com/
It's a great way to use Gatsby with Wordpress.

We're marking this issue as answered and closing it for now but please feel free to comment here if you would like to continue this discussion. We also recommend heading over to our communities if you have questions that are not bug reports or feature requests. We hope we managed to help and thank you for using Gatsby!

@havietduc91
Copy link

Hi @LekoArts,

I'm facing the same issue here with Airtable,

warn Multiple node fields resolve to the same GraphQL field `Airtable.data.Project` - [`Project`, `Project___NODE`]. Gatsby will use `Project___NODE`.
warn Multiple node fields resolve to the same GraphQL field `Airtable.data.Publication` - [`Publication`, `Publication___NODE`]. Gatsby will use `Publication___NODE`.

Could you please let me know the solution to resolve it, many thanks

@szimek
Copy link
Contributor

szimek commented Mar 12, 2020

I've got the same issue with Contentstack (https://www.gatsbyjs.org/packages/gatsby-source-contentstack/):

warn Multiple node fields resolve to the same GraphQL field `Contentstack_post.author` - [`author`, `author___NODE`]. Gatsby will use `author___NODE`.
warn Multiple node fields resolve to the same GraphQL field `Contentstack_post.category` - [`category`, `category___NODE`]. Gatsby will use `category___NODE`.
warn Multiple node fields resolve to the same GraphQL field `Contentstack_post.featured_image` - [`featured_image`, `featured_image___NODE`]. Gatsby will use
...
warn There are conflicting field types in your data.

Could it have any impact on createSchemaCustomization and createTypes call?

@selenecodes
Copy link

selenecodes commented May 5, 2020

I have the same issue with Strapi, in specific the gatsby-source-strapi plugin.

warn Multiple node fields resolve to the same GraphQL field `StrapiCategory.articles.image` - [`image`, `image___NODE`]. Gatsby will use `image___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiArticle.image` - [`image`, `image___NODE`]. Gatsby will use `image___NODE`.

@pjamieson
Copy link

Closed because?

@kulahin
Copy link

kulahin commented Nov 11, 2020

The decision is obvious enough: try not to use the same field names for different types.
I had such warnings in my Gatsby+Wordpress site:
warn Multiple node fields resolve to the same GraphQL field wordpress__wp_event.acf.image -
warn Multiple node fields resolve to the same GraphQL field wordpress__wp_city.acf.image -
warn Multiple node fields resolve to the same GraphQL field wordpress__acf_event.acf.image -
warn Multiple node fields resolve to the same GraphQL field wordpress__acf_city.acf.image -
warn There are conflicting field types in your data.
When I changed the image field name for both types to event_image and city_image the warnings had gone away.
The only issue is that I don't understand why Gatsby behaves so strange...

@JOEMN96
Copy link

JOEMN96 commented Jan 22, 2021

warn Multiple node fields resolve to the same GraphQL field `StrapiCakes.slider.img` - [`img`, `img___NODE`]. Gatsby will use
`img___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiCakes.mainImg` - [`mainImg`, `mainImg___NODE`]. Gatsby will use  
`mainImg___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiBlogs.image` - [`image`, `image___NODE`]. Gatsby will use        
`image___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiFeaturedContents.image` - [`image`, `image___NODE`]. Gatsby will 
use `image___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiHeroslider.AdditionalImg.Imgs` - [`Imgs`, `Imgs___NODE`]. Gatsby 
will use `Imgs___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiHeroslider.slider1` - [`slider1`, `slider1___NODE`]. Gatsby will 
use `slider1___NODE`.

same warning with gatsby strapi plugin

@fnebenfuehr
Copy link

fnebenfuehr commented Apr 13, 2021

I've got the same warning with gatsby-source-shopify

Multiple node fields resolve to the same GraphQL field ShopifyArticle.blog - [blog, blog___NODE]. Gatsby will use blog___NODE.

@jimreesman
Copy link

warn Multiple node fields resolve to the same GraphQL field `StrapiCakes.slider.img` - [`img`, `img___NODE`]. Gatsby will use
`img___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiCakes.mainImg` - [`mainImg`, `mainImg___NODE`]. Gatsby will use  
`mainImg___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiBlogs.image` - [`image`, `image___NODE`]. Gatsby will use        
`image___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiFeaturedContents.image` - [`image`, `image___NODE`]. Gatsby will 
use `image___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiHeroslider.AdditionalImg.Imgs` - [`Imgs`, `Imgs___NODE`]. Gatsby 
will use `Imgs___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiHeroslider.slider1` - [`slider1`, `slider1___NODE`]. Gatsby will 
use `slider1___NODE`.

same warning with gatsby strapi plugin

same.

@jimreesman
Copy link

The decision is obvious enough: try not to use the same field names for different types.
I had such warnings in my Gatsby+Wordpress site:
warn Multiple node fields resolve to the same GraphQL field wordpress__wp_event.acf.image -
warn Multiple node fields resolve to the same GraphQL field wordpress__wp_city.acf.image -
warn Multiple node fields resolve to the same GraphQL field wordpress__acf_event.acf.image -
warn Multiple node fields resolve to the same GraphQL field wordpress__acf_city.acf.image -
warn There are conflicting field types in your data.
When I changed the image field name for both types to event_image and city_image the warnings had gone away.
The only issue is that I don't understand why Gatsby behaves so strange...

agree it's strange. it implies that the gatsby schema keeps node field names in a common namespace (hence the collision for .image when you have event.image and city.image). this creates "pressure" to artificially change the schema (if you are led to believe this is a problem for gatsby). I'd really like a definitive answer from the gatsby devs - if this is actually NOT a concern, then this warning should be removed. Otherwise, if this is a legitimate source of problems, what are the possible problems? How do we avoid them - other than going back to the schema to make it "gatsby-aware"?

@marcinkoziej
Copy link

Same:

warn Multiple node fields resolve to the same GraphQL field `StrapiFrontpage.features.icon` - [`icon`, `icon___NODE`]. Gatsby will use `icon___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiFrontpage.products.image` - [`image`, `image___NODE`]. Gatsby will use `image___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiFrontpage.bannerImage` - [`bannerImage`, `bannerImage___NODE`]. Gatsby will use `bannerImage___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiFrontpage.Video` - [`Video`, `Video___NODE`]. Gatsby will use `Video___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiTestimonial.avatar` - [`avatar`, `avatar___NODE`]. Gatsby will use `avatar___NODE`.

Gatsby libs used:

yarn list |grep gatsby
├─ @gatsbyjs/reach-router@1.3.6
├─ @gatsbyjs/webpack-hot-middleware@2.25.2
├─ babel-preset-gatsby@1.4.0
│  ├─ gatsby-core-utils@^2.4.0
│  └─ gatsby-legacy-polyfills@^1.4.0
├─ create-gatsby@1.4.0
├─ gatsby-awesome-pagination@0.3.8
├─ gatsby-cli@3.4.1
│  ├─ create-gatsby@^1.4.0
│  ├─ gatsby-core-utils@^2.4.0
│  ├─ gatsby-recipes@^0.15.1
│  ├─ gatsby-telemetry@^2.4.1
├─ gatsby-core-utils@2.4.0
├─ gatsby-graphiql-explorer@1.4.0
├─ gatsby-legacy-polyfills@1.4.0
├─ gatsby-link@3.4.0
├─ gatsby-node-helpers@0.3.0
├─ gatsby-page-utils@1.4.0
│  ├─ gatsby-core-utils@^2.4.0
├─ gatsby-plugin-image@1.4.1
│  ├─ gatsby-core-utils@^2.4.0
├─ gatsby-plugin-manifest@3.4.0
│  ├─ gatsby-core-utils@^2.4.0
│  ├─ gatsby-plugin-utils@^1.4.0
├─ gatsby-plugin-offline@4.4.0
│  ├─ gatsby-core-utils@^2.4.0
├─ gatsby-plugin-page-creator@3.4.1
│  ├─ gatsby-core-utils@^2.4.0
│  ├─ gatsby-page-utils@^1.4.0
│  ├─ gatsby-telemetry@^2.4.1
├─ gatsby-plugin-prefetch-google-fonts@1.4.3
├─ gatsby-plugin-react-helmet@4.4.0
├─ gatsby-plugin-sharp@3.4.2
│  ├─ gatsby-core-utils@^2.4.0
│  ├─ gatsby-telemetry@^2.4.1
├─ gatsby-plugin-styled-components@4.4.0
├─ gatsby-plugin-typescript@3.4.0
├─ gatsby-plugin-utils@1.4.0
├─ gatsby-plugin-web-font-loader@1.0.4
├─ gatsby-react-router-scroll@4.4.0
├─ gatsby-recipes@0.15.1
│  ├─ gatsby-core-utils@^2.4.0
│  ├─ gatsby-telemetry@^2.4.1
├─ gatsby-source-filesystem@3.4.0
│  ├─ gatsby-core-utils@^2.4.0
├─ gatsby-source-strapi@0.0.12
│  ├─ gatsby-node-helpers@^0.3.0
│  ├─ gatsby-source-filesystem@^1.5.39
│  ├─ gatsby-source-filesystem@1.5.39
├─ gatsby-telemetry@2.4.1
│  ├─ gatsby-core-utils@^2.4.0
├─ gatsby-transformer-json@3.4.0
├─ gatsby-transformer-sharp@3.4.0
├─ gatsby@3.4.2
│  ├─ @gatsbyjs/reach-router@^1.3.6
│  ├─ @gatsbyjs/webpack-hot-middleware@^2.25.2
│  ├─ babel-preset-gatsby@^1.4.0
│  ├─ gatsby-cli@^3.4.1
│  ├─ gatsby-core-utils@^2.4.0
│  ├─ gatsby-graphiql-explorer@^1.4.0
│  ├─ gatsby-legacy-polyfills@^1.4.0
│  ├─ gatsby-link@^3.4.0
│  ├─ gatsby-plugin-page-creator@^3.4.1
│  ├─ gatsby-plugin-typescript@^3.4.0
│  ├─ gatsby-plugin-utils@^1.4.0
│  ├─ gatsby-react-router-scroll@^4.4.0
│  ├─ gatsby-telemetry@^2.4.1

@marcinkoziej
Copy link

Hey, can this be re-opened?

@purnimagupta
Copy link

I'm also getting this error. I'm using Gatsby and Strapi and using gatsby-source-strapi plugin.

image

Any solution to this?

@purnimagupta
Copy link

purnimagupta commented May 20, 2021

I have the same issue with Strapi, in specific the gatsby-source-strapi plugin.

warn Multiple node fields resolve to the same GraphQL field `StrapiCategory.articles.image` - [`image`, `image___NODE`]. Gatsby will use `image___NODE`.
warn Multiple node fields resolve to the same GraphQL field `StrapiArticle.image` - [`image`, `image___NODE`]. Gatsby will use `image___NODE`.

@selenecodes, Did you find the solution to this?

@avinoamsn
Copy link

avinoamsn commented May 21, 2021

@LekoArts I'm aware that this is not considered an issue & has been closed accordingly. Nevertheless, I think that the people who continue to post in this thread would greatly appreciate some sort of explanation of what is going on here - even just a cursory one. Seeing as this is the top result returned on Google when you search for this warning, I think it's worth providing at least a little bit of info, or a link to some documentation that addresses this.

@jdesherlia
Copy link

A way to squash this would be nice as well, since it doesn't seem to cause any issues... at least not in my case. This seems like a warning about what some might think is a bad architectural design choice, but others think is a perfectly viable way to structure your content. I know in my case, I prefer to name things this way because it makes atomic development easier when I don't have to change the way I reference common models from component to component. Gatsby team, any chance we can silence this warning with a flag?

@tony-gutierrez
Copy link

It does cause issues in my case, results in GraphQL returning null for many of the fields, until I clear cache and rebuild. Getting worse with 5.10.0

@GemN
Copy link

GemN commented Jun 20, 2023

It does cause issues in my case, results in GraphQL returning null for many of the fields, until I clear cache and rebuild. Getting worse with 5.10.0

Same. No workaround found

@danielholmes
Copy link

I had this problem using the strapi source. Turns out it was due to configuring a nested entity incorrectly. i.e.:

{
  singularName: 'menu-item',
  queryParams: {
    publicationState,
    populate: {
      childMenuItems: {
        populate: {
          childMenuItems: {
            populate: {
              childMenuItems: {
                populate: {
                  childMenuItems: {
                    populate: "*"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Caused the issue.

Changing it to the following got rid of the warning display and null fields:

{
  singularName: 'menu-item',
  queryParams: {
    publicationState,
    populate: {
      childMenuItems: {
        populate: "*"
      }
    }
  }
}

@PhilLanzetta
Copy link

Also having this problem when sourcing from gatsby-source-contentful. Have tried renaming fields to no avail. If the cache is cleared, no problem but on subsequent builds:

Multiple node fields resolve to the same GraphQL field ContentfulProject.heroImage - [heroImage___NODE, heroImage]. Gatsby will use heroImage___NODE.

Results in missing images, even though this field is required in my contentful and therefore never null.

@Tmcerlean
Copy link

Also have this issue when sourcing from gatsby-source-contentful... Clearing cache resolves the issue. Whenever an image is uploaded to Contentful I run into the issue described above.

@tony-gutierrez @GemN @PhilLanzetta - I don't suppose any of you managed to resolve this?

@PhilLanzetta
Copy link

I have not. I'm running all of my projects with v5.2 as it doesn't present this problem.

@Tmcerlean
Copy link

Thanks for letting me know, will try out v5.2 now.

@LekoArts - can we reopen this issue please. Several people are unable to build without clearing cache due to this issue. Thanks!

@Tmcerlean
Copy link

@PhilLanzetta FYI I rolled back to 5.6 and all working now.

@nickdraper8
Copy link

@LekoArts is there any update here? Deprecating back to a previous Gatsby version is not possible for me because of some other dependencies that require the newer versions of Gatsby.

@aaronbski
Copy link

This isn't always just an innocuous warning. It randomly breaks our builds in Vercel.

gabsby - 5.11.0
gatsby-source-contentful - 8.11.0

warning Multiple node fields resolve to the same GraphQL field `contentfulBlogPostSummaryTextNode.summary` - [`summary`, `summary___NODE`]. Gatsby will use `summary___NODE`.

...

error There was an error in your GraphQL query:
Field "summary" of type "contentfulBlogPostSummaryTextNode" must have a selection of subfields. Did you mean "summary { ... }"?

Retrying the build without the cache works.

@jthanio
Copy link

jthanio commented Dec 19, 2023

Adding on here. We have the exact same issue where any time this warning appears in the build logs on Netlify, many fields end up as null, causing missing content. Clearing cache works, but it's quite slow compared to incremental builds. I do think this issue should be re-opened, or at least rephrased and referenced in a new issue.

Edit: did #38728 fix this? Looks like there was a release yesterday for the gatsby-source-contentful plugin at least.

@chawes13
Copy link
Contributor

We've had this issue since we were forced to migrate from Gatsby Cloud to Netlify. Might just be a coincidence in terms of timing of releases of Gatsby and/or the contentful-source-plugin. It's quite painful – the incremental builds are already so much slower on Netlify. Having to manually clear the cache multiple times a day isn't great.

@receter
Copy link

receter commented Oct 15, 2024

I had a similar issue and was able to solve it with a schema customization:

Error:

warn Multiple node fields resolve to the same GraphQL field `STRAPI_EXAMPLE_CATEGORY.descriptionLong.data` - [`data`, `data___NODE`]. Gatsby will use
`data___NODE`.

gatsby-node.js

exports.createSchemaCustomization = ({ actions }) => {
  const { createTypes } = actions;
  createTypes(`
    type STRAPI_EXAMPLE_CATEGORY implements Node {
      descriptionLong: JSON
    }`)
}

Probably this is causes by a outdated Strapi version (v4.10.5)…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests