Skip to content

GrapQL - Error when querying an entry with a empty oEmbed URL #156

@jaapfaes

Description

@jaapfaes

Issue:
When running a GraphQL query to fetch an entry that includes an oEmbed field, an error occurs if the oEmbed field does not have a URL specified.

Error Message:
Embed\Embed::get(): Argument #1 ($url) must be of type string, null given, called in /var/www/vhosts/aswakeukens.nl/subdomains/cms/vendor/wrav/oembed/src/services/OembedService.php on line 89

Proposed Solution:
I believe this issue can be easily resolved by passing an empty string when the $url value is null. This prevents the error and allows the query to return a valid response.

Pull Request:
I've created a small PR that addresses this issue. You can review it here: #157.

Thank you for looking into this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions