Skip to content

Mysql Input handler -> No mark columns auto_increment, nullable and with default values as mandatory on generated input schema  #2182

Closed
@jarpz

Description

@jarpz

Is your feature request related to a problem? Please describe.

When you use mysql-input handler and some tables have "default" values, It would be desirable for those columns not to be required on input over mutation table

if you declare a table like:

create table mytable (     id int auto_increment not null primary key ,     name varchar(50) not null,age datetime NOT NULL DEFAULT '0000-00-00 00:00:00', created date );

you expect when you mutation over that table for columns:
id, created and even "age" not to be "required"

Describe the solution you'd like

any column mark as "nullable", "with default value" or auto_increment type not need too be marked as required on mutation for that table.

Additional context

mutation {
	insertMytable(mytable: {
    name: "optimus",
    created: "2021-01-01"
  }) {
    id,
    age,
    created
  }
}

error:

 "message": "Field \"MytableInsertInput.id\" of required type \"Int!\" was not 

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions