graphql-mesh icon indicating copy to clipboard operation
graphql-mesh copied to clipboard

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

Open jarpz opened this issue 3 years ago • 1 comments

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 

jarpz avatar May 21 '21 05:05 jarpz

@jarpz Did you find any workaround for this issue?

ashokkumar88 avatar Nov 30 '21 11:11 ashokkumar88