Filter objectTypeNames for non-batched hydration - #706
Conversation
| * | ||
| * Could be empty if there are no object types involved e.g. returns scalar, enum etc. | ||
| */ | ||
| val backingFieldReturnsObjectTypeNames: Set<String> |
There was a problem hiding this comment.
Precomputes this info and stores it.
|
|
||
| val queries = NadelHydrationFieldsBuilder | ||
| .makeBatchBackingQueries( | ||
| executionHints = executionContext.hints, |
There was a problem hiding this comment.
Need to evaluate FF for new behavior.
| } else { | ||
| virtualField.children | ||
| } | ||
| ), |
There was a problem hiding this comment.
This is the fix needed.
| val fieldChildren = if (executionHints.hydrationFilterObjectTypes()) { | ||
| deepClone(fields = filterChildren(instruction, virtualField.children)) + | ||
| makeObjectIdFields(executionBlueprint, aliasHelper, instruction) | ||
| } else { |
There was a problem hiding this comment.
So thing is, we applied this type name filtering for batch hydrations but not for non-batched hydration.
I unified the behavior and also moved the getBackingFieldOverallObjectTypenames to be precomputed in the instruction.
Also moved the filtering to before deepClone so we don't unnecessarily clone objects we were about to filter anyway.
FF is here to ensure smooth rollout.
| else -> onNotObjectType(unwrappedType) | ||
| } | ||
| return type.unwrapAll() | ||
| .whenType( |
There was a problem hiding this comment.
Edited this to use the new whenType
| internal val isPartitionedCall: Boolean = false, | ||
| internal val executionCoroutine: CoroutineScope, | ||
| ) { | ||
| private val serviceContexts = ConcurrentHashMap<String, CompletableFuture<Any?>>() |
There was a problem hiding this comment.
Remanent code, not used
| private fun getReturnsObjectTypeNames( | ||
| backingField: GraphQLFieldDefinition, | ||
| virtualTypeContext: NadelVirtualTypeContext?, | ||
| ): Set<String> { |
There was a problem hiding this comment.
Function that precomputes returned object type names
No description provided.