Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[QUESTION]/[BUG]: GraphQL input document with multiple queries (operations) fails with "Trying to add top-level with existing name"

Open
#3,532 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
graphql
Domain
api

Research direction

Start by reproducing the failure through the quicktype CLI using a GraphQL document with multiple operations and shared fragments, targeting Kotlin and Swift as reported. Determine whether multiple operations should convert successfully or require a documented limitation; done means the intended behavior is established and verified against this reproduction.

Written by the indexing model from the issue text.

Description

bug

Hi,

I have a GraphQL document with multiple queries (operations). When trying to convert this document to whatever (tried Kotlin and Swift), Quicktype errors with "Trying to add top-level with existing name". Is there a way to convert such documents? I am using multiple queries inside one document because I want to reuse (i.e. not duplicate) GraphQL fragments. Or is fragment reuse somehow possible otherwise?

Thanks!

[email protected] NPM package via CLI

Dominant language
TypeScript
Stars
13.9k
Forks
1.2k
Avg merge
6h 54m
Merged PRs (30d)
80

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from glideapps/quicktype

All issues in glideapps/quicktype

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.