menu

Apollo

A community of developers, designers and others who love Apollo and GraphQL. 🚀

Channels
# All channels
view-forward
# General
view-forward
# Apollo Angular
view-forward
# Announcements
view-forward
# Apollo Android
view-forward
# Apollo Client
view-forward
# Apollo iOS
view-forward
# Apollo Link
view-forward
# Apollo Link Rest
view-forward
# Local State
view-forward
# Apollo Studio
view-forward
# Apollo Server
view-forward
# Apollo Tooling
view-forward
# Contributing
view-forward
# Docs
view-forward
# Events
view-forward
# GraphQL Tools
view-forward
# Jobs
view-forward
# Random
view-forward
# React Apollo
view-forward
# Showcase
view-forward
# Subscriptions
view-forward
# Testing
view-forward
# Vue Apollo
view-forward
Team
Hugh Willson
@hwillson
Ellen Shapiro
@designatednerd
Jesse Rosenberger
@abernix
Jake Dawkins
@jakedawkins
Martin B
@mbonnin
James Baxley
@jamesbaxley
Jason Paulos
@jasonpaulos
Julia Black
@juliablack
Khalil Stemmler
@khalilstemmler
Martijn Walraven
@martijnwalraven
Jenn Creighton
@jenncreighton
Peggy Rayzis
@peggy
Ben Church
@bnchrch
Trevor Scheer
@trevor-scheer
Adam Zionts
@zionts
Danielle Man
@daniman
Evans Hauser
@evans
Stephen Barlow
@stephen-barlow
Ashi Krishnan
@rakshesha
Michael Watson
@michael-watson
Thao
@thao
Justin Anastos
@justin-anastos
Tim Hingston
@timbotnik
Adam Torres
@adamatorres
Alisha Ehrlich
@alisha-ehrlich
Chang Wang
@cheapsteak
Claire Hough
@clairehough
David Glasser
@glasser
François Dufour
@francois-dfr
Matt DeBergalis
@debergalis
Sachin D. Shinde
@sachin-shinde
Posts
Members
Info

Mutation doesn't resolve in Jest test

Getting the following error: Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout. The console.log('created log') never runs. I've been stuck on this for two days, so any help would be hugely appreciated! The test: …

thumbsup
0
message-simple
0

Fragment is not working with MockedProvider

When I use a fragment in my code, it works in a browser environment, but it fails in the tests when using MockedProvider from Apollo. If my Fragment looks like this: My fragment looks like this: …

thumbsup
1
message-simple
5

fields contained in fragment are not being returned from mocks

Intended outcome: I'm trying to write some tests that involve some queries that contains fragments in them. The fields in the fragments get retrieved just fine in the local environment, but when I try to run it through jest, I get back all the fields except for the ones in the…

thumbsup
1
message-simple
1

MockedProvider never returns any data

[email protected] with testing-library/[email protected] i am using useLazyQuery and in test mode it never resolves. loading is always true and data always undefined. My mock query and variables match exactly the query and variables used in the component i am testing, yet i still get no…

thumbsup
0
message-simple
1

withApollo `TypeError: Cannot read property 'query' of undefined`

libraries used Component setup Unit Test …

thumbsup
1
message-simple
2

`no more mocked responses for the query: ...` while mocking errors

Since I upgraded to @apollo/client v3 I've been getting this error no more mocked responses for the query: ... while testing query error states. Logs: Mocked response: …

thumbsup
0
message-simple
1

MockedProvider: How to handle multiple requests that have same variables?

Example based on https://www.apollographql.com/docs/react/development-testing/testing/ });

thumbsup
0
message-simple
2

Why use MockedProvider when I can spyOn 'useQuery'?

After struggling for hours on implementing MockedProvider into my test setup (it is still not working and query results are undefined) I was asking myself why to use the MockedProvider in the first place and not just provide a mocked return value for the useQuery…

thumbsup
1
message-simple
0

What is the proper way to wait for reactive variables in tests?

I asked a question on StackOverflow with all the details and examples: Can someone have a look and answer the thread? https://stackoverflow.com/questions/63880395/what-is-the-proper-way-to-wait-for-reactive-variables-in-tests

thumbsup
1
message-simple
0

MockedProvider test only passes when other is skipped

I have Test A that only passes when the other test, Test B is set to skip. It seems as if the mock isn't getting cleared or something? (Using React testing library.)

thumbsup
0
message-simple
4