Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generating duplicate types on fragments

See original GitHub issue

Issue Description

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:

ERROR in /Users/fang/app/src/__generated__/gatsby-types.ts(10461,13):
10461:13 Duplicate identifier 'GatsbyContentfulSizes_withWebp_noBase64Fragment'.
    10459 | export type GatsbyContentfulSizes_withWebpFragment = Pick<ContentfulSizes, 'base64' | 'aspectRatio' | 'src' | 'srcSet' | 'srcWebp' | 'srcSetWebp' | 'sizes'>;
    10460 | 
  > 10461 | export type GatsbyContentfulSizes_withWebp_noBase64Fragment = Pick<ContentfulSizes, 'aspectRatio' | 'src' | 'srcSet' | 'srcWebp' | 'srcSetWebp' | 'sizes'>;
          |             ^
    10462 | 
    10463 | export type PagesQueryQueryVariables = {};
    10464 | 

failed Building development bundle - 50.337s

^ 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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

fandycommented, Feb 18, 2020

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 🎉

cometkimcommented, Feb 18, 2020

Hey @fandy, can you test it again on v1.1.0? please try and let me know if the problem still happens

Read more comments on GitHub >

github_iconTop Results From Across the Web

v1.15.0 generating duplicate fragment definitions · Issue #4143
Describe the bug I have a graphql directory containing a number of .graphql files containing a mix of queries, mutation and fragments.
Read more >
Fragments - Apollo GraphQL Docs
A GraphQL fragment is a piece of logic that can be shared between multiple queries and mutations. ... Every fragment includes a subset...
Read more >
android - How do I duplicate fragments? - Stack Overflow
The fragment has a TextView , by passing parameters to the Fragment, I want to display different text inside each TextView of the...
Read more >
Duplicate Code - Refactoring.Guru
If duplicate code is found in two different classes: If the classes aren't part of a hierarchy, use Extract Superclass in order to...
Read more >
4. Write Code Once - Building Maintainable Software, Java ...
To resolve duplication using Extract Method, the duplicate (or a part thereof) is extracted into a new method which is then called multiple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found