MutationTestTag

open class MutationTestTag<T, S>(val tag: String) : TestTag

TestTag implementation for Mutation operations that provides tag-based identification.

This class is used to identify mutations for mocking in test and preview environments, particularly when dealing with auto-generated mutation IDs that may change during configuration changes or recompositions.

Unlike MutationId which might use auto-generated values that can change across recompositions, MutationTestTag provides a stable identifier that can be consistently referenced in tests and previews.

Usage example:

// Define a test tag
class UpdateUserMutationTestTag : MutationTestTag<User, UserUpdateParams>("update-user")

// Use with test client
testClient.on(UpdateUserMutationTestTag()) { updatedUser }

// Apply when getting a mutation
val mutation = client.getMutation(mutationKey, Marker.testTag(UpdateUserMutationTestTag()))

Parameters

T

The type of data that will be returned by the mutation

S

The type of input parameters for the mutation

tag

A unique string identifier for this test tag

Constructors

Link copied to clipboard
constructor(tag: String)

Properties

Link copied to clipboard
open override val tag: String

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int