Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
filipwronski opened this issue Oct 3, 2018 · 1 comment
Closed

Comments

@filipwronski
Copy link

filipwronski commented Oct 3, 2018

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;
                    }
                }
            },
        },
@filipwronski filipwronski changed the title How I can assigne to query result on client side? How I can assigne more values on client side to server side result? Oct 3, 2018
@Akryum
Copy link
Member

Akryum commented Jan 9, 2019

See #469

@Akryum Akryum closed this as completed Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants