Uncaught exception when unset uri properties are requested

Created on 22 July 2025, about 1 month ago

Problem/Motivation

I've the attribution module installed and exposed the Attribution fields via Graphql-Config.
When I query an entity with the Attribution field that has not all source links set I encounter the following response:

  "debugMessage": "The URI '' is invalid. You must use a valid URI scheme.",
  "message": "Internal server error",
  "extensions": {
    "category": "internal"
  },
  "locations": [
    {
      "line": 389,
      "column": 11
    }
  ],

Steps to reproduce

  1. Install Attribution module
  2. Add Attribution field to a node
  3. Add testing node, leave one Attribution source URL empty
  4. Expose Attribution field in graphql-config
  5. Query testing node including Attribution-Fields

Proposed resolution

\Drupal\graphql_core_schema\CoreComposableResolver::resolveItem() should handle URL items like the other items in that if $result->getValue() is NULL it returns a "default".

Remaining tasks

  1. Write Code
  2. Review
  3. Commit

User interface changes

None

API changes

None

Data model changes

None.

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇨🇭Switzerland das-peter

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024