Interfaces & Types
Social Feeds adds interfaces to Craft’s GraphQL schema for its feeds, sources and posts. Queries shows how to request them through the socialFeeds query. All fields are nullable.
Interfaces
The SocialFeedsInterface Interface
The socialFeeds query returns this interface, which holds the plugin’s queries. Select feeds, feed, sources or source inside it, as described in Queries.
The FeedInterface Interface
A feed, returned by the feeds and feed queries.
The ID of the feed.
The unique identifier of the feed.
The name of the feed.
The handle of the feed.
Whether the feed is enabled.
The feed’s sources. This field takes the same arguments as the sources query.
The SourceInterface Interface
A source, returned by the sources and source queries and a feed’s sources field.
The ID of the source.
The unique identifier of the source.
The name of the source.
The handle of the source.
Whether the source is enabled.
The date the source last fetched posts from its provider, or null when it hasn’t fetched yet.
The display name of the source’s provider, such as YouTube.
The handle of the source’s provider, such as youTube.
The provider’s brand colour as a hex value.
The provider’s icon as SVG markup.
Whether the source is connected to its provider with a saved access token.
The source’s posts, newest first. This field takes limit and offset arguments, described in Query Posts.
The PostInterface Interface
A post, returned by a source’s posts field.
posts(limit: 1) {
text
postType
tags
links {
title
url
}
videos {
url
}
}{
"posts": [
{
"text": "Our new range is out now.",
"postType": "video",
"tags": "[\"launch\",\"summer\"]",
"links": [],
"videos": [
{ "url": "https://example.com/video.mp4" }
]
}
]
}The post’s ID on the provider.
The provider’s unique identifier for the post item.
The post’s title, for providers that give posts one, such as YouTube. This is null for most posts.
The post’s main text or description.
The URL of the post on the provider’s site.
The ID of the source the post was fetched from.
The handle of the source the post was fetched from.
The handle of the source’s provider, such as instagram.
The kind of post, for providers that classify them, such as image, video or event.
The number of likes the post has, or null when the provider doesn’t report it.
The number of shares the post has, or null when the provider doesn’t report it.
The number of replies or comments the post has, or null when the provider doesn’t report it.
The date the post was published on the provider.
The date the post was last updated on the provider, when the provider reports it.
The author who published the post, or null when the provider doesn’t supply one.
A JSON string of the post’s tags or hashtags, such as ["summer","sale"].
The links attached to the post.
The images attached to the post.
The videos attached to the post.
A JSON string of the full response for the post from the provider’s API, with access tokens and other secrets removed.
A JSON string of any extra provider-specific values kept alongside the post.
The PostAuthorInterface Interface
The author of a post, returned by a post’s author field.
The author’s ID on the provider.
The author’s username on the provider, for providers that have one.
The author’s display name.
The URL of the author’s profile on the provider.
The URL of the author’s profile photo.
The PostLinkInterface Interface
A link attached to a post, returned by a post’s links field.
The link’s ID on the provider, when it has one.
The link’s title, when the provider supplies one.
The URL the link points to.
The PostMediaInterface Interface
An image or video attached to a post, returned by a post’s images and videos fields.
The media item’s ID on the provider.
The media item’s title or alternative text, when the provider supplies one.
The kind of media item, either image or video.
The URL of the image or video file.
The width of the media item in pixels, when the provider reports it.
The height of the media item in pixels, when the provider reports it.