So how can I do, or is possible to have 2 types on the input fields? For example, I have like:
input UpdatePersonInput {
first_name: String
surname: String
age: Int
}
extend type Mutation {
updatePerson(id: ID!, input: UpdatePersonInput!): Person! @field(resolver: "App\\GraphQL\\Mutations\\Person@update")
}
On my input, I want a type Int but at the same time want the type null (this type don't exist by my knowledge) to update on DB the field age on Persons (like some people give age and some don't). This is a simple example, but my code is more complex and I can't be checking if the key comes or not in the input like
key_exists('age', $args['input'])
on the resolver method update. I am using lighthouse graphql v4.16.