Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Add index types for compatibility with graphql-tools #171

Closed
wants to merge 1 commit into from

Conversation

OrKoN
Copy link
Contributor

@OrKoN OrKoN commented Oct 21, 2018

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.

return `
export interface Type {
[key: string]: any;
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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.

@schickling
Copy link
Contributor

Sorry for double-review. GitHub had an outage during the time of review.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/discussion status/on-hold This issue is on hold.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants