Skip to content

Instantly share code, notes, and snippets.

@mczachurski
Last active October 10, 2017 18:48
Show Gist options
  • Save mczachurski/490595a98ce805bdc845ea267ab69b26 to your computer and use it in GitHub Desktop.
Save mczachurski/490595a98ce805bdc845ea267ab69b26 to your computer and use it in GitHub Desktop.
public class GroupsResolver : Resolver, IGroupsResolver
{
private readonly IGroupsService _groupsService;
public GroupsResolver(IGroupsService groupsService)
{
_groupsService = groupsService;
}
public void Resolve(GraphQLQuery graphQLQuery)
{
graphQLQuery.Field<ListGraphType<GroupType>>(
"groups",
resolve: context => _groupsService.GetGroupsAsync()
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment