Skip to content

Add query key as additional parameter to result callback, #445 #448

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

Merged
merged 2 commits into from
Jan 9, 2019

Conversation

fnoop
Copy link
Contributor

@fnoop fnoop commented Nov 18, 2018

Add the query key as an additional to the result callback function, to allow the callback function to identify which query the result is coming from. This is very useful to use allow manual SmartQuery instances to take action based on what type or client of query is incoming. This is particularly crucial when trying to use vue-apollo to connect to multiple backends with the same schema (#216).

@fnoop
Copy link
Contributor Author

fnoop commented Nov 18, 2018

ps - the key parameter might be more intuitive as the first parameter, but added after data to leave it backwards compatible with existing code.

@fnoop
Copy link
Contributor Author

fnoop commented Nov 18, 2018

result callback call from subscription also needs key parameter added (subsequent push)

@Akryum Akryum merged commit 5a92745 into vuejs:master Jan 9, 2019
@fnoop
Copy link
Contributor Author

fnoop commented Jan 9, 2019

Thank you :)

@fnoop fnoop deleted the callback-key branch January 9, 2019 08:57
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

Successfully merging this pull request may close these issues.

2 participants