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
Several times we've run into situations where our constructed name for a type (e.g., PascalCase(method name) + "Params") conflicts with an actual named type in the API. We have worked around this by renaming things in the API and that continues to be a fine strategy, but we could completely eliminate this problem by putting the real structs from Nexus in one namespace and our made-up ones in another.
TypeScript has explicit namespace concept, but it's considered a bit old-school. The more idiomatic way of namespacing things is putting them in their own module and importing that module. However, this has the downside of turning our very convenient single-file generated client into multiple files. And it seems namespaces are not going away. So the simplest thing is probably to use namespace.
The text was updated successfully, but these errors were encountered:
I'd prefer we not use namespaces. In the eventual future of publishing the SDK to NPM whether it's a single file or multiple files is a bit moot. Better we provide clarity of scope and consistent patterns than use something fairly out of date that folks would likely be unfamiliar with.
Several times we've run into situations where our constructed name for a type (e.g.,
PascalCase(method name) + "Params"
) conflicts with an actual named type in the API. We have worked around this by renaming things in the API and that continues to be a fine strategy, but we could completely eliminate this problem by putting the real structs from Nexus in one namespace and our made-up ones in another.TypeScript has explicit
namespace
concept, but it's considered a bit old-school. The more idiomatic way of namespacing things is putting them in their own module and importing that module. However, this has the downside of turning our very convenient single-file generated client into multiple files. And it seems namespaces are not going away. So the simplest thing is probably to usenamespace
.The text was updated successfully, but these errors were encountered: