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

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

Closed
jarpz opened this issue May 21, 2021 · 1 comment · Fixed by #5882
Assignees

Comments

@jarpz
Copy link

jarpz commented May 21, 2021

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 
@ashokkumar88
Copy link

@jarpz Did you find any workaround for this issue?

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

Successfully merging a pull request may close this issue.

3 participants