Skip to content

Required properties in Create Resolvers #144

@israelglar

Description

@israelglar

Reposting in right repo from graphql-compose/graphql-compose#151

I have a User schema

const UserSchema = new Mongoose.Schema(
  {
    email: {type: String, unique: true, required: true},
    name: {type: String, required: true},
  },
  {
    timestamps: true,
  },
);

After using composeWithMongoose and exposing all CRUD resolvers the result for the Create methods are:

type CreateOneUserInput {
  email: String
  name: String
  updatedAt: Date
  createdAt: Date
}
type CreateManyUserInput {
  email: String
  name: String
  updatedAt: Date
  createdAt: Date
}

The properties email and name should be required.

I just recently started using the library, so maybe there is something in docs that I didn't see.
If it's a bug, I can contribute with a fix with some guidance.
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions