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

Remove needless $Types namespace #128

Closed
jasonkuhrt opened this issue Aug 28, 2021 · 1 comment · Fixed by #130
Closed

Remove needless $Types namespace #128

jasonkuhrt opened this issue Aug 28, 2021 · 1 comment · Fixed by #130
Assignees
Labels
note/breaking-change This issue existed already type/improve Something existing is made better, does not affect the interface (example: better error message)

Comments

@jasonkuhrt
Copy link
Contributor

jasonkuhrt commented Aug 28, 2021

What

import { $Types, Bar } from 'nexus-prisma'

type Bar = $types.Bar
const bar = Bar

Can be simplified to:

import {Bar } from 'nexus-prisma'

type Bar = Bar
const bar = Bar

Thanks to TS being able to share names across different name spaces of types versus terms.

Why

Simoler API, "just works" intuitive.

Note

When I designed the original API I did not understand that TS allowed this name re-use across the term/type levels.

@jasonkuhrt jasonkuhrt added type/improve Something existing is made better, does not affect the interface (example: better error message) note/breaking-change This issue existed already labels Aug 28, 2021
@jasonkuhrt jasonkuhrt self-assigned this Aug 28, 2021
jasonkuhrt added a commit that referenced this issue Aug 28, 2021
@rostislav-simonik-nexus-prisma-admin
Copy link
Collaborator

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
note/breaking-change This issue existed already type/improve Something existing is made better, does not affect the interface (example: better error message)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants