Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-5329

GraphQL throws an error if we query content with a non-existent translation

    XMLWordPrintable

Details

    Description

      Steps to reproduce

      1. Install Ibexa DXP
      2. Add a new language e.g. fre-FR (BO and yaml file)
      3. Create a CT with all our supported fields without translation
      4. Regenerate graphQL schema
      5. Create content from created CT
      6. Publish
      7. Execute a query similar to the following:
      {
        content {
          allInOne(id: 142) {
              newEzcontentquery (language: fre_FR) {
                  orderBy
              }
           newEzauthor1(language: fre_FR) {
            name
          },
            newEzboolean2(language: fre_FR),
            newEzobjectrelation3(language: fre_FR){
              _name
            },
            newEzobjectrelationlist4(language: fre_FR) {
              _name
            },
            newEzcountry5(language: fre_FR),
            newEzdate6(language: fre_FR) {
              timestamp
            },
            newEzdatetime7(language: fre_FR) {
              timestamp
            },
            newEzemail8(language: fre_FR),
            newEzbinaryfile9(language: fre_FR) {
              fileName
            },
            newEzfloat10(language: fre_FR),
            newEzform11(language: fre_FR),
            newEzisbn12(language: fre_FR),
            newEzimage13(language: fre_FR) {
              fileName
            },
            newEzimageasset14(language: fre_FR) {
              fileName
            },
            newEzinteger15(language: fre_FR),
            newEzkeyword16(language: fre_FR),
            newEzlandingpage17(language: fre_FR) {
              layout
            },
            newEzgmaplocation18(language: fre_FR) {
              address
            },
            newEzmedia20(language: fre_FR) {
              fileName
            },
            newEzrichtext21(language: fre_FR) {
              text
            },
            newEztext22(language: fre_FR),
            newEzstring23(language: fre_FR),
            newEztime24(language: fre_FR),
            newEzurl25(language: fre_FR)
          }
        }
      }  

       

      Result

      Below, what errors graphQL returns for a given field

      Field Message
      Ezcontentquery Argument 2 passed to EzSystems\\EzPlatformQueryFieldType\\GraphQL
      QueryFieldResolver::resolveQueryFieldConnection() must be an instance of EzSystems\\EzPlatformGraphQL\\GraphQL\\Value
      Field, null given
      Ezauthor Warning: Attempt to read property \"authors\" on null
      Ezboolean Warning: Attempt to read property \"bool\" on null
      Ezobjectrelation EzSystems\\EzPlatformGraphQL
      GraphQL
      Resolver
      DomainContentResolver::resolveDomainRelationFieldValue(): Argument #1 ($field) must be of type EzSystems\\EzPlatformGraphQL
      GraphQL
      Value
      Field, null given, called in /var/www/html/vendor/overblog/graphql-bundle/src/Resolver/AbstractProxyResolver.php on line 32
      Ezobjectrelationlist4 EzSystems\\EzPlatformGraphQL
      GraphQL
      Resolver
      DomainContentResolver::resolveDomainRelationFieldValue(): Argument #1 ($field) must be of type EzSystems\\EzPlatformGraphQL
      GraphQL
      Value
      Field, null given, called in /var/www/html/vendor/overblog/graphql-bundle/src/Resolver/AbstractProxyResolver.php on line 32
      Ezdate Warning: Attempt to read property \"date\" on null
      Ezdatetime Warning: Attempt to read property \"date\" on null
      Ezfloat Warning: Attempt to read property \"value\" on null
      Ezimageasset EzSystems\\EzPlatformGraphQL
      GraphQL
      Resolver
      ImageAssetFieldResolver::resolveDomainImageAssetFieldValue(): Argument #1 ($field) must be of type EzSystems\\EzPlatformGraphQL
      GraphQL
      Value
      Field, null given, called in /var/www/html/vendor/overblog/graphql-bundle/src/Resolver/AbstractProxyResolver.php on line 32
      Ezinteger Warning: Attempt to read property \"value\" on null
      Ezkeyword Warning: Attempt to read property \"value\" on null
      Ezlandingpage Warning: Attempt to read property \"values\" on null

       

       

      Expected:

      the result should look like with other fields, i.e. null value returned

      {
        "data": {
          "content": {
            "allInOne": {
              "newEzcountry5": null,
              "newEzemail8": null,
              "newEzbinaryfile9": null,
              "newEzform11": null,
              "newEzisbn12": null,
              "newEzimage13": null,
              "newEzgmaplocation18": null,
              "newEzmedia20": null,
              "newEzrichtext21": null,
              "newEztext22": null,
              "newEzstring23": null,
              "newEztime24": null,
              "newEzurl25": null
            }
          }
        }
      } 

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              mateusz.debinski@ibexa.co Mateusz Dębiński
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: