I am implementing a React Typescript app that communicates to a Kotlin backend using GraphQL (Apollo on the Frontend).
My mutation is :
updateProfile(input: UpdateProfileInput)
input UpdateProfileInput {
firstName: String
lastName: String
email: String
}
I am supposed to send as an input only the fields that have been changed. So I should not send email if it’s the same to what it currently is in our database.
My question is, on the Frontend, will it work is I set the value to null, or would it still detects on the Backend that the field was sent?
For example, is it the same if I send input1
and input2
(as the fields are nullable):
const input1 = {
firstName: null,
lastName: null,
email: "[email protected]" //<- updated email
}
const input2 = {
email: "[email protected]"
}