Abstract type File must resolve to an Object type at runtime for field FieldItemTypeImage.entity

Created on 22 November 2024, about 1 month ago

Problem/Motivation

When updating from 1.0.13 to 1.0.20 I can't get information of a image file in a menu item anymore.

Following query worked in 1.0.13

query GetDirectAccessLinks {
  entityQuery(
    entityType: MENU
    filter: {conditions: {field: "id", value: "menu-acc-s-direct"}}
  ) {
    items {
      id
      ... on Menu {
        id
        label
        links {
          link {
            url {
              path
            }
            label
            content {
              ... on MenuLinkContentMenuAccSDirect {
                id
                fieldIcon {
                  alt
                  targetId
                  entity {
                    uriRawField {
                      first {
                        url
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

in 1.0.20 it throws this error

Abstract type File must resolve to an Object type at runtime for field FieldItemTypeImage.entity with value \"instance of Drupal\\file_entity\\Entity\\FileEntity\", received \"File\". Either the File type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function.
🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇪🇸Spain abelass

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024