FakeResolver
Provides fakes values for Data builders
Functions
Link copied to clipboard
Resolves a leaf (scalar or enum) type. Note that because of list and not-nullable types, the type of context.mergedField
is not always the leaf type. You can get the type of the leaf type with:
Link copied to clipboard
Resolves the size of a list. Note that lists might be nested. You can use context.path
to get the current nesting depth
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun stableIdForObject(obj: Map<String, Any?>, mergedField: CompiledField): String?
Content copied to clipboard
Use stableIdForObject to provide FakeResolverContext.id. You can then use FakeResolverContext.id to derive stable values in the resolveXyz() methods above. This way, you're guaranteed that a fake object will have the same field values no matter its path in the query.