Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapped Context type can't be named Context #1681

Closed
koenpunt opened this Issue Apr 9, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@koenpunt
Copy link
Contributor

koenpunt commented Apr 9, 2019

Describe the bug

When specifying contextType in the config with a type called Context, the generated typescript file will contain multiple Context types, because Context is also the name of the generic parameter.

This should be easily solvable by changing the name of the generic parameter.

koenpunt added a commit to koenpunt/graphql-code-generator that referenced this issue Apr 9, 2019

change generic parameter name to prevent clash
when having a context interface name `Context`, it didn't work because the generic parameter was referring to itself. By naming it `ContextType` it's less common, and thus the change of having clash is smaller.

fixes dotansimha#1681

koenpunt added a commit to koenpunt/graphql-code-generator that referenced this issue Apr 12, 2019

change generic parameter name to prevent clash
when having a context interface name `Context`, it didn't work because the generic parameter was referring to itself. By naming it `ContextType` it's less common, and thus the change of having clash is smaller.

fixes dotansimha#1681

koenpunt added a commit to koenpunt/graphql-code-generator that referenced this issue Apr 12, 2019

change generic parameter name to prevent clash
when having a context interface name `Context`, it didn't work because the generic parameter was referring to itself. By naming it `ContextType` it's less common, and thus the change of having clash is smaller.

fixes dotansimha#1681

koenpunt added a commit to koenpunt/graphql-code-generator that referenced this issue Apr 12, 2019

change generic parameter name to prevent clash
when having a context interface name `Context`, it didn't work because the generic parameter was referring to itself. By naming it `ContextType` it's less common, and thus the change of having clash is smaller.

fixes dotansimha#1681

dotansimha added a commit that referenced this issue Apr 14, 2019

change generic parameter name to prevent clash (#1682)
when having a context interface name `Context`, it didn't work because the generic parameter was referring to itself. By naming it `ContextType` it's less common, and thus the change of having clash is smaller.

fixes #1681

@dotansimha dotansimha reopened this Apr 14, 2019

@dotansimha

This comment has been minimized.

Copy link
Owner

dotansimha commented Apr 17, 2019

Fixed in 1.1.0 🚀

@dotansimha dotansimha closed this Apr 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.