grapher icon indicating copy to clipboard operation
grapher copied to clipboard

Query $options order in relations different from client to server

Open erixtekila opened this issue 5 years ago • 1 comments

Hi,

I use grapher react HOC. If I query from react, the order is correct.

export default withQuery
(
    ( props ) =>
    {      
        return query.clone( { _id : props._id } );
    }
    ,{
        reactive : true
        ,single : true
        , loadingComponent: Spin
    }
)( UI );

The query

export default createQuery
(
    {
        building :
        {
            // Dynamic filter
            $filter( { filters, options, params } )
            { 
                if( params._id ) filters._id = params._id;               
            }
          ,flats :
            {
                // options
                $options:
                {
                    sort: { date : 1 }
                },
                date       :1
         }
}

But if I use the same query serverside, the order goes wrong. Any clue ?

const building = query.clone( { _id } ).fetchOne();
const flats = expertise.flats;
console.log(flats);

erixtekila avatar Jun 17 '19 17:06 erixtekila

I'm seeing this same issue too

josephto avatar Oct 25 '19 22:10 josephto