-
Notifications
You must be signed in to change notification settings - Fork 23
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
Generating duplicate types on fragments #33
Comments
Hey @Fandy , thank you for reporting this! Can you provide some example or starter project I can test on? |
Yes if you clone https://github.com/gatsbyjs/gatsby/tree/master/examples/using-contentful and add the typegen plugin, it should error |
I just tested on gatsby-contentful-starter with |
my bad. It does not depend on apollo's graphql-tag at all |
No duplicate identifiers appear in emitted plugin documents that are actually loaded. This is likely a bug in graphql-codegen. Hey @dotansimha, Can you help me solve this problem? config:
output: fragment GatsbyContentfulFixed on ContentfulFixed {
base64
width
height
src
srcSet
}
fragment GatsbyContentfulFixed_tracedSVG on ContentfulFixed {
tracedSVG
width
height
src
srcSet
}
fragment GatsbyContentfulFixed_noBase64 on ContentfulFixed {
width
height
src
srcSet
}
fragment GatsbyContentfulFixed_withWebp on ContentfulFixed {
base64
width
height
src
srcSet
srcWebp
srcSetWebp
}
fragment GatsbyContentfulFixed_withWebp_noBase64 on ContentfulFixed {
width
height
src
srcSet
srcWebp
srcSetWebp
}
fragment GatsbyContentfulFluid on ContentfulFluid {
base64
aspectRatio
src
srcSet
sizes
}
fragment GatsbyContentfulFluid_tracedSVG on ContentfulFluid {
tracedSVG
aspectRatio
src
srcSet
sizes
}
fragment GatsbyContentfulFluid_noBase64 on ContentfulFluid {
aspectRatio
src
srcSet
sizes
}
fragment GatsbyContentfulFluid_withWebp on ContentfulFluid {
base64
aspectRatio
src
srcSet
srcWebp
srcSetWebp
sizes
}
fragment GatsbyContentfulFluid_withWebp_noBase64 on ContentfulFluid {
aspectRatio
src
srcSet
srcWebp
srcSetWebp
sizes
}
fragment GatsbyContentfulResolutions on ContentfulResolutions {
base64
width
height
src
srcSet
}
fragment GatsbyContentfulResolutions_tracedSVG on ContentfulResolutions {
tracedSVG
width
height
src
srcSet
}
fragment GatsbyContentfulResolutions_noBase64 on ContentfulResolutions {
width
height
src
srcSet
}
fragment GatsbyContentfulResolutions_withWebp on ContentfulResolutions {
base64
width
height
src
srcSet
srcWebp
srcSetWebp
}
fragment GatsbyContentfulResolutions_withWebp_noBase64 on ContentfulResolutions {
width
height
src
srcSet
srcWebp
srcSetWebp
}
fragment GatsbyContentfulSizes on ContentfulSizes {
base64
aspectRatio
src
srcSet
sizes
}
fragment GatsbyContentfulSizes_tracedSVG on ContentfulSizes {
tracedSVG
aspectRatio
src
srcSet
sizes
}
fragment GatsbyContentfulSizes_noBase64 on ContentfulSizes {
aspectRatio
src
srcSet
sizes
}
fragment GatsbyContentfulSizes_withWebp on ContentfulSizes {
base64
aspectRatio
src
srcSet
srcWebp
srcSetWebp
sizes
}
fragment GatsbyContentfulSizes_withWebp_noBase64 on ContentfulSizes {
aspectRatio
src
srcSet
srcWebp
srcSetWebp
sizes
}
query PagesQuery {
allSitePage(filter: { path: { ne: "/dev-404-page/" } }) {
nodes {
path
}
}
} |
|
FYI I'm not using
I wonder if generating outside |
@Fandy |
Sorry. a few more several tests, even if I created a file outside of src, the same issue occurs when a document changed. |
|
Hey @Fandy, can you test it again on v1.1.0? please try and let me know if the problem still happens |
@cometkim duplicate types are still being generated in I've upgraded the plugin to the latest version. |
on using-contentful example? |
No, it's in my repo but let me see if I can reproduce in the using-contentful example... |
@cometkim yup, it's happening in the using-contentful example too. It's only duplicated on the Contentful fragment types. |
@Fandy just fixed some weird yarn 2 resolution problem, and confirmed v1.1.1 is working using-contentful example with no duplicated fragments, can you try one more? |
Peeerfect, 1.1.1 is confirmed to be working. I tested on 1.0.1 which didn't work before. Thank you for fixing this 🎉 |
Thank you for all the work on the v1 release! I'm experiencing duplicate types being generated when using this along with a plugin that has introspecting GraphQL like Contentful:
^ This is just one example, it's happening for all fragments. Is there a current workaround for this or will there need to be a fix? @cometkim
The text was updated successfully, but these errors were encountered: