fix: update removing a relationship with null (#1056)

This commit is contained in:
Dan Ribbens
2022-09-02 15:21:09 -04:00
committed by GitHub
parent 254636167d
commit 44b0073834
2 changed files with 13 additions and 1 deletions

View File

@@ -184,6 +184,18 @@ describe('Relationships', () => {
customIdNumberRelation: 'bad-input',
})).rejects.toThrow('The following field is invalid: customIdNumberRelation');
});
it('should allow update removing a relationship', async () => {
const result = await client.update<Post>({
slug,
id: post.id,
data: {
relationField: null,
},
});
expect(result.status).toEqual(200);
});
});
describe('depth', () => {