Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Latest commit

 

History

History
41 lines (30 loc) · 778 Bytes

oembed.md

File metadata and controls

41 lines (30 loc) · 778 Bytes

oEmbed Field

oEmbed fields are added to the WPGraphQL Schema as a field with the Type String.

oEmbed fields can be queried, and a String will be returned.

Here, we have a oEmbed field named oembed on the Post Edit screen within the "ACF Docs" Field Group.

oEmbed field in the Edit Post screen

This field can be Queried in GraphQL like so:

{
  post(id: "acf-example-test", idType: URI) {
    acfDocs {
      oembed
    }
  }
}

and the results of the query would be:

{
  "data": {
    "post": {
      "acfDocs": {
        "oembed": "https://www.youtube.com/watch?v=ZEytXfaWwcc"
      }
    }
  }
}