Skip to content

Add a Vue Apollo example #143

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 1 commit into from
May 24, 2020
Merged

Add a Vue Apollo example #143

merged 1 commit into from
May 24, 2020

Conversation

cilice
Copy link
Contributor

@cilice cilice commented May 22, 2020

Closes #141

I had some freedom the pick some kind of a mocking client for apollo since vue-apollo doesn't provide one.
I also used screen, is that alright or should i redo it using the destructing approach used everywhere else?

@codecov
Copy link

codecov bot commented May 22, 2020

Codecov Report

Merging #143 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #143   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           69        69           
  Branches        13        13           
=========================================
  Hits            69        69           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a7c0fd...293ab74. Read the comment docs.

Copy link
Member

@afontcu afontcu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm by no means an Apollo expert, but looks great! Thank you for this

I also used screen, is that alright or should i redo it using the destructing approach used everywhere else?

Totally fine. screen is the suggested way to within Testing Lib ecosystem, so at some point docs and examples should be updated. Glad that this one is already in shape :)

@cilice
Copy link
Contributor Author

cilice commented May 22, 2020

I guess I should also add a note this is only for Apollo v2 and will not work with Apollo v3.

@cilice
Copy link
Contributor Author

cilice commented May 22, 2020

Things I've changed now:

  • clarified the setup
  • added some remarks about apollo-client v2
  • added a loading example and added some comments around the needed await for data to appear, since fetching is async

I think this PR is in a good state now, feel free to merge. 🙌 ✨

@afontcu
Copy link
Member

afontcu commented May 22, 2020

@cilice I think this comment went out the minute you pushed, you might have missed it xD

#143 (comment)

@cilice
Copy link
Contributor Author

cilice commented May 22, 2020

Oh thats neat, it somehow never crossed my mind to solve it like this. It's great! I've changed it now and squashed it all into one commit.

@cilice
Copy link
Contributor Author

cilice commented May 22, 2020

@afontcu I think it’s ready to merge 🙏

@afontcu afontcu merged commit 03429fc into testing-library:master May 24, 2020
@cilice cilice deleted the add-example-apollo branch May 25, 2020 08:28
@afontcu
Copy link
Member

afontcu commented Jun 6, 2020

🎉 This PR is included in version 5.0.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vue-apollo example
2 participants