Skip to content

Conversation

@jasonbahl
Copy link
Contributor

@jasonbahl jasonbahl commented Nov 2, 2023

What does this implement/fix? Explain your changes.

This updates the oEmbed field to return the results of wp_oembed_get() instead of returning the raw URL that was input to the field.

Does this close any currently open issues?

closes #106

Any relevant logs, error output, GraphiQL screenshots, etc?

Before:

CleanShot 2023-10-31 at 08 58 24

After:

CleanShot 2023-10-31 at 08 54 32

Any other comments?

This is probably considered a breaking change to users that were previously getting the raw URL in response and doing something on the client with the url (i.e. fetching the oembed from the source, etc)

If needed, for users negatively impacted by this change, the graphql_resolve_field filter can be used to override the resolver for the field(s) to return the previous resolver logic.

- update tests to reflect the oembed response
@jasonbahl jasonbahl added the compat: breaking change This is a breaking change to existing functionality label Nov 2, 2023
@jasonbahl jasonbahl requested a review from josephfusco November 2, 2023 21:30
@jasonbahl jasonbahl self-assigned this Nov 2, 2023
@jasonbahl jasonbahl merged commit 62fcc6a into main Nov 6, 2023
@jasonbahl jasonbahl deleted the fix/#106-oembed-field-support branch January 24, 2024 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compat: breaking change This is a breaking change to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oEmbed field type returns url, not embed

2 participants