title: Amplify DataStore Validation error of type FieldUndefined
body: <p>I have problem with <code>DataStore.save()</code> . I want to create chat room, but I get error</p>
  <blockquote>
  <p>DataStore - subscriptionError, Connection failed: {&quot;errors&quot;:[{&quot;message&quot;:&quot;Validation error of type FieldUndefined: Field 'chatroom' in type 'ChatRoomUser' is undefined @ 'onUpdateChatRoomUser/chatroom'&quot;}]}</p>
  </blockquote>
  <p>I'm using react-native and Expo</p>
  <p>My function:</p>
  <pre><code>const onPress = async () =&gt; {
        //Create a chat room
        const newChatRoom = await DataStore.save(new ChatRoom({newMessages: 0}))
        //Connect auth user with the chat room
        const authUser = await Auth.currentAuthenticatedUser()
        const dbUser = await DataStore.query(User, authUser.attributes.sub)
        await DataStore.save(new ChatRoomUser({
          user: dbUser,
          chatroom: newChatRoom
        }))
  
        //Connect clicked user with the chat room
        await DataStore.save(new ChatRoomUser({
          user,
          chatroom: newChatRoom
        }))
  
        console.log(newChatRoom)
  
        navigation.navigate('ChatRoom' as never, {id: newChatRoom.id} as never)
      }
  
  </code></pre>