Closed leighman closed 5 years ago
Hi @leighman , thank you for reporting this issue.
We are trying to improve and find the best solution for naming, but that's not always easy.
In general, I think naming a field with the same name might be confusing for developers who consume it.
We currently does not have a proper solution for this case, but you can try to use namingConvention: none
to avoid changing the names of the types.
@dotansimha Thanks. As far as I can see it looks like I could override namingConvention: typeNames:
in ^0.16 but currently blocked from updating by the https://github.com/dotansimha/graphql-code-generator/pull/1194 regression
@leighman you can use the latest alpha to get this fix before we release it:
- graphql-code-generator@0.17.0-alpha.fad8d485
- graphql-codegen-core@0.17.0-alpha.fad8d485
- codegen-templates-scripts@0.17.0-alpha.fad8d485
- graphql-codegen-plugin-handlebars-helpers@0.17.0-alpha.fad8d485
- graphql-codegen-plugin-helpers@0.17.0-alpha.fad8d485
- graphql-codegen-add@0.17.0-alpha.fad8d485
- graphql-codegen-flow-documents@0.17.0-alpha.fad8d485
- graphql-codegen-flow-resolvers@0.17.0-alpha.fad8d485
- graphql-codegen-flow@0.17.0-alpha.fad8d485
- graphql-codegen-fragment-matcher@0.17.0-alpha.fad8d485
- graphql-codegen-introspection@0.17.0-alpha.fad8d485
- graphql-codegen-schema-ast@0.17.0-alpha.fad8d485
- graphql-codegen-time@0.17.0-alpha.fad8d485
- graphql-codegen-typescript-apollo-angular@0.17.0-alpha.fad8d485
- graphql-codegen-typescript-client@0.17.0-alpha.fad8d485
- graphql-codegen-typescript-common@0.17.0-alpha.fad8d485
- graphql-codegen-typescript-graphql-files-modules@0.17.0-alpha.fad8d485
- graphql-codegen-typescript-mongodb@0.17.0-alpha.fad8d485
- graphql-codegen-typescript-react-apollo@0.17.0-alpha.fad8d485
- graphql-codegen-typescript-resolvers@0.17.0-alpha.fad8d485
- graphql-codegen-typescript-server@0.17.0-alpha.fad8d485
- graphql-codegen-typescript-stencil-apollo@0.17.0-alpha.fad8d485
- graphql-codegen-apollo-angular-template@0.17.0-alpha.fad8d485
- graphql-codegen-graphql-files-typescript-modules@0.17.0-alpha.fad8d485
- graphql-codegen-introspection-template@0.17.0-alpha.fad8d485
- graphql-codegen-typescript-mongodb-template@0.17.0-alpha.fad8d485
- graphql-codegen-typescript-react-apollo-template@0.17.0-alpha.fad8d485
- graphql-codegen-typescript-resolvers-template@0.17.0-alpha.fad8d485
- graphql-codegen-typescript-template@0.17.0-alpha.fad8d485
Fixed in 0.18.0 🎉
Describe the bug Duplicate type
IdResolver
is generated for fieldsid
andID
.To Reproduce
Use a type like
Generate resolvers
See compile error for duplicate types
Expected behavior Generated types should be
IdResolver
andIDResolver
? Is there any way to work around this other than manually editing the generated file?Environment: