Error/Amplify DataStore

Field id should be of type number, string recived

conqueror-G 2022. 10. 10. 17:11

πŸ‘ Error 사진

-

πŸ‘€ Error 이름

Field id should be of type number, string recived

πŸ«€ Error 원인

1. shema.graphql을 잘λͺ» μž‘μ„±ν•˜μ§€λŠ” μ•Šμ•˜λŠ”μ§€ 체크

2. 데이터 μŠ€ν† μ–΄μ— μ €μž₯ν•˜λŠ” μ½”λ“œκ°€ 잘λͺ»λ˜μ—ˆμ„ κ°€λŠ₯μ„± 체크

⚑️ Error 해결방법

<ν•΄κ²° μ „ μ½”λ“œ>
await DataStore.save(new DiaryPost({
	{ // 원인 λ°œμƒμ§€
		title: '',
		content: '',
	}
}))

<ν•΄κ²° ν›„ μ½”λ“œ>
await DataStore.save(new DiaryPost({
	...{   
		title: '',
		content: '',
	   }
}))