I have some models where graphql inputs are not ge...
# graphql-nexus
w
I have some models where graphql inputs are not generated properly. I need input
UserCreateInput
but there’s only
UserCreateWithoutPostsInput
. What decides whether the plain input is generated or not ?
I’m looking to do something like this:
Copy code
extendType({
  type: 'Mutation',
  definition(t) {
    t.field('createUser', {
      type: 'User',
      args: {
        data: arg({ type: 'UserCreateInput' }),
      },
      nullable: false,
      async resolve(_root, args, ctx, info) {
        return createUser(_root, args, ctx, info);
      },
    });
  },
});
but
UserCreateInput
is not found
a
These inputs are generated for
t.crud
usage so now if you added
t.crud.users({ filtering: true, ordering: true })
you will get all user inputs generated if you need to get all inputs already generated you can use my Pal.js to generate all your inputs
@windkomo if you need to auto-generate all CRUD and Inputs use my Pal.JS CLI to do this
w
thanks, I had to add
_t.crud.createOneUser_()
in my
mutationType
👍 1
a
Yes and if you need to auto-generate all this
t.model
and
t.crud
you can use the small tool I built https://paljs.com/cli/cnt
w
looks great, thanks