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

inputObjectTypes exposed all fields #503

Open
Bjoernstjerne opened this issue Oct 22, 2019 · 2 comments
Open

inputObjectTypes exposed all fields #503

Bjoernstjerne opened this issue Oct 22, 2019 · 2 comments

Comments

@Bjoernstjerne
Copy link

I like the approach to white listen fields in ObjectTypes, why do InputObjectTypes includes all fields? For now I have to rewrite all InputTypes:

import {inputObjectType} from "nexus";

export const UserUpdateInput = inputObjectType({
    name: "UserUpdateInput",
    definition(t){
        t.string('email', {required: false})
    }
})

It would be very nice to have something like this:

import {inputObjectType} from "nexus";

export const UserUpdateInput = inputObjectType({
    name: "UserUpdateInput",
    definition(t){
        t.model('User').email()
    }
})
@durdenx
Copy link

durdenx commented Jan 22, 2021

@mazzaker is there a workaround ? This is what prevents us from migrating to prisma 2...

@Bjoernstjerne
Copy link
Author

@durdenx We rewrite all inputTypes, using only nexus without nexus-prisma-plugin. I changed the generator from https://github.com/paljs/prisma-tools to our needs (folder structure, one file per Input).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants