Add index types for compatibility with graphql-tools #171
Conversation
return ` | ||
export interface Type { | ||
[key: string]: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would really like to avoid adding this as this massively weakens the type-safety of the generated resolvers. I believe that we'll need to introduce a change to the types directly in graphql-tools
.
return ` | ||
export interface Type { | ||
[key: string]: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would really like to avoid adding this as this massively weakens the type-safety of the generated resolvers. I believe that we'll need to introduce a change to the types directly in graphql-tools
.
return ` | ||
export interface Type { | ||
[key: string]: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would really like to avoid adding this as this massively weakens the type-safety of the generated resolvers. I believe that we'll need to introduce a change to the types directly in graphql-tools
.
return ` | ||
export interface Type { | ||
[key: string]: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would really like to avoid adding this as this massively weakens the type-safety of the generated resolvers. I believe that we'll need to introduce a change to the types directly in graphql-tools
.
Sorry for double-review. GitHub had an outage during the time of review. |
I have checked the issue #124 Right now graphql-tools is complaining because index signatures are missing. To make it type-safe, you probably need to generate enum types for keys and, instead of any, to use union types. This PR makes it compatible with graphql-tools.