You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Typescript 3.7+ can compile classes generated with apollo client:codgen, regardless of how mutations are named.
Actual outcome:
An error occurs during compilation, if the name of the mutation matches the name of the exposed mutation.
For example, when the mutation looks like:
mutation UpdateBook($bookID: ID!, $input: UpdateBook!) {
UpdateBook(bookID: $bookID, input: $input) {
ID
Title
Author
}
}
Compilation fails with: error TS2440: Import declaration conflicts with local declaration of 'UpdateBook'
However if the mutation name is changed to:
mutation UpdateBookMutation($bookID: ID!, $input: UpdateBook!) {
UpdateBook(bookID: $bookID, input: $input) {
ID
Title
Author
}
}
The code compiles just fine. Unfortunately I have quite a few existing mutations I would prefer not to rename if possible. Can the generated typescript code use aliased imports?
Intended outcome:
Typescript 3.7+ can compile classes generated with apollo client:codgen, regardless of how mutations are named.
Actual outcome:
An error occurs during compilation, if the name of the mutation matches the name of the exposed mutation.
For example, when the mutation looks like:
Compilation fails with:
error TS2440: Import declaration conflicts with local declaration of 'UpdateBook'
However if the mutation name is changed to:
The code compiles just fine. Unfortunately I have quite a few existing mutations I would prefer not to rename if possible. Can the generated typescript code use aliased imports?
How to reproduce the issue:
Reproduction case available here: https://github.com/rogersp/apollo-codegen-example
Versions
Typescript 3.7+ (see: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#local-and-imported-type-declarations-now-conflict)
Apollo 2.28.0
The text was updated successfully, but these errors were encountered: