diff --git a/src/Context/FieldResolver.php b/src/Context/FieldResolver.php
index b50dd3e..6b20d8b 100644
--- a/src/Context/FieldResolver.php
+++ b/src/Context/FieldResolver.php
@@ -121,7 +121,7 @@ class FieldResolver {
       // Update the resource type with the referenced type.
       $resource_types = $this->collectResourceTypesForReference($definitions[$field_name]);
       // Update the entity type with the referenced type.
-      $entity_type_id = $definitions[$field_name]->getSetting('target_type');
+      $entity_type_id = $definitions[$field_name]->getTargetBundle();
       // $field_name may not be a reference field. In that case we should treat
       // the rest of the parts as complex fields.
       if (empty($entity_type_id)) {
@@ -175,7 +175,7 @@ class FieldResolver {
     if (!$main_property_definition instanceof DataReferenceTargetDefinition) {
       return [];
     }
-    $entity_type_id = $field_definition->getSetting('target_type');
+    $entity_type_id = $field_definition->getTargetBundle();
     $handler_settings = $field_definition->getSetting('handler_settings');
     if (empty($handler_settings['target_bundles'])) {
       // If target bundles is NULL it means ALL of the bundles in the entity ID
