We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I found a problem, if request more than one queries, the result hook call multiple times and the response data is messy.
my code:
const categoryQuery = gql` query { category { rows { id name icon zindex }, count } }`; const cityQuery = gql` query { city { rows { id name }, count } }`; apollo: { getCategories: { query() { return categoryQuery; } , update(data) { return data.category.rows; }, result(data) { console.log('****should print categories****') console.log(data.category.rows); }, error(error) { this.$notify({ title: '错误', message: '获取演出类型列表失败', type: 'error' }); } }, getCities: { query() { return cityQuery; } , update(data) { return data.city.rows; }, result(data) { console.log('---should print cities---') console.log(data.city.rows); }, error(error) { this.$notify({ title: '错误', message: '获取城市列表失败', type: 'error' }); } } }
But I get the result:
---should print cities--- // correct ["cityA", "cityB", "cityC"] ****should print categories**** // correct ["categoryA", "categoryB", "categoryC", "categoryD"] ---should print cities--- // messy ["categoryA", "categoryB", "categoryC"]
More queries, the data result is more messy.
The text was updated successfully, but these errors were encountered:
Please reopen if you still have the issue.
Sorry, something went wrong.
Akryum
No branches or pull requests
I found a problem, if request more than one queries, the result hook call multiple times and the response data is messy.
my code:
But I get the result:
More queries, the data result is more messy.
The text was updated successfully, but these errors were encountered: