@Retention(value=RUNTIME) @Target(value=PARAMETER) @Documented public @interface Source
public class CharacterService {
@Inject TwitterService twitterService;
@Query(value = "tweets")
@Description = "Get the last tweets for a character")
public List <Tweet > tweets(
@Source("tweetsForMe") @Description("Get the last tweets for the character") Character character,
@Argument("last") @Description = "Number of last tweets to fetch") int last) {
return twitterService.search(character.getName(), last);
}
}
Schema generation of this would result in a stanza such as:
type Character {
# Other fields ...
# Get the last tweets for the character
# last: Number of last tweets to fetch
tweetsForMe(last: Int): [Tweet]
}
public abstract String name
Copyright © 2019 Eclipse Foundation. All rights reserved.