public PostType(InWinkData data) { Name = "Post"; Field(h => h.Id).Description("The id of the post."); Field(h => h.Content, nullable: true).Description("The firstName of the post."); }
public UserType(InWinkData data) { Name = "User"; // Field(h => h.Id); No description Field(h => h.Id).Description("The id of the user."); Field(h => h.FirstName, nullable: true).Description("The firstName of the user."); Field(h => h.LastName, nullable: true).Description("The lastName of the user."); }
public InWinkQuery(InWinkData data) { Name = "Query"; // User: Field <ListGraphType <UserType> >( "users", resolve: context => data.GetUsers() ); Field <UserType>( "user", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <StringGraphType> > { Name = "id", Description = "id of the user" } ), resolve: context => data.GetUserByIdAsync(context.GetArgument <string>("id")) ); // Post: Field <ListGraphType <PostType> >( "posts", resolve: context => data.GetPosts() ); Field <PostType>( "post", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <StringGraphType> > { Name = "id", Description = "id of the post" } ), resolve: context => data.GetPostsByIdAsync(context.GetArgument <string>("id")) ); }