2929 * label = @Translation("Bundle context"),
3030 * required = FALSE,
3131 * ),
32- * "field_types_context" = @ContextDefinition("any ",
32+ * "field_types_context" = @ContextDefinition("string ",
3333 * label = @Translation("Field types context"),
3434 * required = FALSE,
3535 * )
@@ -110,15 +110,15 @@ public function __construct(
110110 * The entity type definition.
111111 * @param array|null $bundle_context
112112 * Bundle context.
113- * @param array |null $field_types_context
113+ * @param string |null $field_types_context
114114 * Field types context.
115115 * @param \Drupal\graphql\GraphQL\Execution\FieldContext $field_context
116116 * Field context.
117117 */
118118 public function resolve (
119119 EntityTypeInterface $ entity_definition ,
120120 ?array $ bundle_context = NULL ,
121- ?array $ field_types_context = NULL ,
121+ ?string $ field_types_context = NULL ,
122122 FieldContext $ field_context
123123 ): \Iterator {
124124
@@ -140,14 +140,13 @@ public function resolve(
140140 }
141141
142142 if ($ field_types_context ) {
143- $ field_types = $ field_types_context ['key ' ];
144143 foreach ($ fields as $ field ) {
145- if ($ field_types === 'BASE_FIELDS ' ) {
144+ if ($ field_types_context === 'BASE_FIELDS ' ) {
146145 if ($ field instanceof BaseFieldDefinition) {
147146 yield $ field ;
148147 }
149148 }
150- elseif ($ field_types === 'FIELD_CONFIG ' ) {
149+ elseif ($ field_types_context === 'FIELD_CONFIG ' ) {
151150 if ($ field instanceof FieldConfig || $ field instanceof BaseFieldOverride) {
152151 yield $ field ;
153152 }
0 commit comments