lolopinto / ent

MIT License
51 stars 6 forks source link

Cannot have two graphQL methods that return the same object type in the same file #1821

Open Swahvay opened 1 month ago

Swahvay commented 1 month ago

If I create a custom graphQL object type for a return on a function, I cannot use it for two functions within the same file (or maybe globally too?). If I do I get the following error when running codegen:

Error 
  template: schema.tmpl:9:4: executing "schema.tmpl" at <reserveImport $typ.ImportPath $typ.Type>: 
  error calling reserveImport: HorseCompetitionWatchType is already imported from path
  src/graphql/generated/mutations/watch_horse_in_competition_type. duplicate path:
  src/graphql/generated/mutations/unwatch_horse_in_competition_type @ file 
  src/graphql/generated/schema.ts