Amplify Toolbox
    Preparing search index...
    • Define a custom type. This type represents an inline, typed JSON object.

      Type Parameters

      • T extends CustomTypeFields

      Parameters

      • fields: T

        the fields to be added to the custom type

      Returns CustomType<{ fields: T }>

      a custom type

      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'),
      }),
      });