Implements a new FormField model, which wraps the GF_Field object.
Implements a FormFields dataloader, for storing and caching our GF_Fields.
Refactors FormFieldsConnectionResolver to use AbstractConnectionResolver and the new model/dataloader.
Changed the GfFormField interface to implement the Node interface.
Why
Part of #298
How
FormField.id is no longer deprecated, and is now a global Relay ID.
Testing Instructions
Additional Info
Form/Entry -> FormField resolvers now pass the FormField model instead of the GF_Field object. While the model has been set up to pass-through to the underlying object, class checks (e.g. $source instanceof GF_Field ) will _no longer work and should be updated to the following:
...
'resolve' => static function( $source, array $args, AppContext $context, ResolveInfo $info ) {
- if ( $source instance of GF_Field_Text ) { }
+ // use the underlying $source->gfEntry
+ if ( $source->gfEntry instanceof GF_FieldText ) {}
...
},
Checklist:
[x] This PR is tested to the best of my abilities.
[x] This PR follows the WordPress Coding Standards.
[x] This PR has proper inline documentation.
[x] This PR has unit tests to verify the code works as intended.
[x] The changes in this PR have been noted in CHANGELOG.md
What
This PR:
FormField
model, which wraps theGF_Field
object.FormFields
dataloader, for storing and caching ourGF_Field
s.FormFieldsConnectionResolver
to useAbstractConnectionResolver
and the new model/dataloader.GfFormField
interface to implement theNode
interface.Why
Part of #298
How
FormField.id
is no longer deprecated, and is now a global Relay ID.Testing Instructions
Additional Info
FormField
resolvers now pass theFormField
model instead of theGF_Field
object. While the model has been set up to pass-through to the underlying object, class checks (e.g.$source instanceof GF_Field
) will _no longer work and should be updated to the following:Checklist: