Skip to content

Put schemas in their own module for namespacing #121

@david-crespo

Description

@david-crespo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions