This replaces the default implementations for @_required and @_optional.
These directives are now handled by checking for field._directives.required and field._directives.optional directly inside the readSelection logic.
This should enhance @_optional to also work on fields with selection sets properly.
Set of changes
Remove defaultDirectives from implementation
Add handling of directives.optional and directives.required directly to readSelection
Summary
This replaces the default implementations for
@_required
and@_optional
. These directives are now handled by checking forfield._directives.required
andfield._directives.optional
directly inside thereadSelection
logic.This should enhance
@_optional
to also work on fields with selection sets properly.Set of changes
defaultDirectives
from implementationdirectives.optional
anddirectives.required
directly toreadSelection