Define a custom type. This type represents an inline, typed JSON object.
the fields to be added to the custom type
a custom type
https://docs.amplify.aws/react/build-a-backend/data/data-modeling/add-fields/#specify-a-custom-field-type
a.schema({ Post: a.model({ location: a.customType({ lat: a.float(), long: a.float(), }), content: a.string(), }),}); Copy
a.schema({ Post: a.model({ location: a.customType({ lat: a.float(), long: a.float(), }), content: a.string(), }),});
a.schema({ Location: a.customType({ lat: a.float(), long: a.float(), }), Post: a.model({ location: a.ref('Location'), content: a.string(), }), User: a.model({ lastKnownLocation: a.ref('Location'), }),}); Copy
a.schema({ Location: a.customType({ lat: a.float(), long: a.float(), }), Post: a.model({ location: a.ref('Location'), content: a.string(), }), User: a.model({ lastKnownLocation: a.ref('Location'), }),});
Define a custom type. This type represents an inline, typed JSON object.