Skip to content

How I can assigne more values on client side to server side result? #406

Closed
@filipwronski

Description

@filipwronski

I'm creating listing with load more option. On server side I'm loading first 12 results of query and on client side I want to add values from "load more" to server side result.

On server side I haven't access to "this" so i don't now how assign to result of server side and client side to the same variable 👎

Here is my query:

apollo: {
            searchProperties: {
                query: PROPERTY_LISTING_SEARCH,
                prefetch: (route) => {
                    return {
                        searchFilters: {
                            type: 'FLAT',
                            transaction: 'SALE',
                            dictionaries: []
                        },
                        numberOfResults: 12,
                        pageNumber: 1,
                        searchOrder: {
                            sortKey: "RANK",
                            sortOrder: "ASC"
                        },
                    }
                },
                variables () {
                    return {
                        searchFilters: this.searchFilters,
                        numberOfResults: this.pagination.elementsPerPage,
                        pageNumber: 1,
                        searchOrder: {
                            sortKey: this.sort.sortKey,
                            sortOrder: this.sort.sortOrder,
                        },
                    };
                },
                result(data) {
                    if(process.client) {
                        console.log(data.data.searchProperties)
                    }

                    this.loading = data.loading;
                    if (!this.viewLoaded) {
                        this.viewLoaded = true;
                    }
                }
            },
        },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions