• Build an expression that can be used to filter which items of a given Model are synchronized down from the GraphQL service. E.g.,

    import { DataStore, syncExpression } from 'aws-amplify/datastore';
    import { Post, Comment } from './models';


    DataStore.configure({
    syncExpressions: [
    syncExpression(Post, () => {
    return (post) => post.rating.gt(5);
    }),
    syncExpression(Comment, () => {
    return (comment) => comment.status.eq('active');
    })
    ]
    });

    When DataStore starts syncing, only Posts with rating > 5 and Comments with status === 'active' will be synced down to the user's local store.

    Type Parameters

    Parameters

    Returns Promise<{
        conditionProducer: ConditionProducer<T, A>;
        modelConstructor: PersistentModelConstructor<T>;
    }>

    An sync expression object that can be attached to the DataStore syncExpressions configuration property.