Page tree
Skip to end of metadata
Go to start of metadata

The "mentioned" query returns a List of mentions for the current user. The query can accept various attributes of pagination options from the BasicPaginationEnum.

NOTE

The "mentioned" query can only be called from a user-authenticated WWClient. They cannot be called from an application-authenticated WWClient. This is because those queries are looking for mentions for an individual. An application does not have any mentions.

The org.opencode4workspace.builders.MentionedGraphQLQuery class has a simple static helper method, buildFullMentionedQuery(). Similar methods are also available from WWClient and WWGraphQLEndpoint.

For greater control, create an ObjectDataSenderBuilder for the Mentioned.MENTIONED_QUERY_OBJECT_NAME object, adding attributes, passing in Mentioned fields and children. Instantiate a new MentionedGraphQLQuery passing in the ObjectDataSenderBuilder as the parameter. Then pass this to WWClient.getMentionedWithQuery(). SInce 0.8.0 you can also pass this to WWClient.getMentionedContainerWithQuery(). The first one just returns the List of Mentioned objects, the second one gives access to the MentionedContainer, which gives access to the PageInfo object and the List of Mentioned objects.

Examples

getMentions
@Test
public void getMentions() throws WWException, UnsupportedEncodingException {
    List<Mentioned> mentions = client.getMentioned();
    assert(mentions.size() == 10);
    Mentioned mention = mentions.get(0);
    assertEquals(mention.getPerson().getDisplayName(), "CHRISTIAN Guedemann");
}
  • No labels
Write a comment…