menu
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 Platform
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
Posts
Members
Info

Is there a simpler way to test?

Reading through the full stack tutorial tests it seems there is a lot of boilerplate to get a reliable/consistent test suite up. How necessary/reliable is all of the test setup in the fullstack tutorial? I am using apollo-server-koa, pg, and knex and trying to write integration…

thumbsup
1
message-simple
0

[Possible bug] Testing multiple mutations: second mutation never reached

Hi, I need help with this problem. I've been testing my registration component which uses 3 mutations, 1 for user registration, 1 for authentication to obtain the JWT token, and a local @client third to set the current user into localStorage. The problem is, when I set all the…

thumbsup
0
message-simple
0

How do you unit test the result of a mutation in vue & apollo

I posted on stackoverflow and am really struggling to test the behavior of a successful mutation with Apollo. https://stackoverflow.com/questions/59339110/testing-graphql-apollo-and-vue-js

thumbsup
0
message-simple
0

How to test useLazyQuery?

I love the documentation about testing react components with useQuery and useMutation. (https://www.apollographql.com/docs/react/development-testing/testing/) But I struggle when testing the useLazyQuery-hook. …

thumbsup
2
message-simple
3

How do I get rid of these act console errors"

I'm converting my code to use apollo hooks and I'm running into problems when updating the unit test. I can't get rid of this no matter what I do. I've wrapped it in the act module and updated my version of react to latest to make sure I have the async version.

thumbsup
0
message-simple
2

How do I test that a mutation is run when using MockedProvider?

Hi! I'm working with React and Apollo. I have a component with a button that fires a mutation when clicked. I would like to write a test that confirms that when the button is clicked, the mutation is fired. Reading the docs on testing mutations there doesn't seem to be a way to…

thumbsup
4
message-simple
17

How to avail data when fetchPolicy: "cache-and-network" using MockedProvider

I have useQuery hook in my component as below. const { subscribeToMore, loading, error, data, refetch } = useQuery< getData …

thumbsup
0
message-simple
0

Is testing with Mock reliable?

I have a doubt in MockedProvider section https://www.apollographql.com/docs/react/development-testing/testing/#mockedprovider If we mock all the graphql request, it will pass the test suite. But, it might loss consistency with actual implementation. Hence, it results bug in…

thumbsup
0
message-simple
6

Testing react components - additional information.

https://www.apollographql.com/docs/react/development-testing/testing/#testing-loading-states The documented example doesn't mention why act errors appear, how to avoid them and also that providing an empty array of mocks results in an error object being defined. The act errors…

thumbsup
0
message-simple
0

Has anyone could able to figure out how to resolve this error?

Invariant Violation: Argument of passed to parser was not a valid GraphQL DocumentNode. You may need to use 'graphql-tag' or another method to convert your operation into a document

thumbsup
0
message-simple
4