Hi there what should I do to skip some field If th...
# prisma-whats-new
v
Hi there what should I do to skip some field If they are empty
Copy code
export const UPDATE_USER_MUTATION = gql`
    mutation updateUser(
    $id : ID!,
    $fullName: String!,
    $username: String!,
    $avatarId: ID!,
    $email: String!
    ){
        updateUser(
            id: $id,
            fullName: $fullName,
            username: $username,
            avatarId: $avatarId,
            email: $email
        ){
            id
            fullName
            username
            avatar{
                url
            }
            email
            age
        }
    }
`;
And when I update fields without file ID, I got an error GraphQL error: Variable '$avatarId' expected value of type 'ID!' but value is undefined. Reason: Expected non-null value, found null. (line 1, column 71): mutation updateUser($id: ID!, $fullName: String!, $username: String!, $avatarId: ID!, $email: String!)
m
Also interested in skipping empty fields.
v
just delete "!" from fields except first field
m
Oh I meant getting an empty array return value instead of null. Thanks though!