8000 Caching GraphQL queries by grokys · Pull Request #2181 · github/VisualStudio · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Caching GraphQL queries #2181

Merged
merged 20 commits into from
Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3d1ea19
Added caching to GraphQL connections.
grokys Jan 7, 2019
b046d6d
Implement refreshing PR list and details.
grokys Jan 16, 2019
bbdcf99
Merge branch 'master' into feature/graphql-caching
StanleyGoldman Feb 27, 2019
14eadbe
Update submodule
StanleyGoldman Feb 27, 2019
ff484ab
Fixing compilation errors
StanleyGoldman Feb 28, 2019
c3b597f
Passing through the call to refresh
StanleyGoldman Feb 28, 2019
4d140c6
Merge remote-tracking branch 'remotes/origin/master' into feature/gra…
StanleyGoldman Mar 8, 2019
81ed3b4
Cache assignable users for an hour
StanleyGoldman Mar 8, 2019
63c829c
Merge branch 'master' into feature/graphql-caching
StanleyGoldman Mar 14, 2019
00da02c
Caching ReadViewer for 10 minutes
StanleyGoldman Mar 14, 2019
e9395e8
Adding functionality to refresh user repository list
StanleyGoldman Mar 14, 2019
ade3b5f
Ensuring the first load is never cached
StanleyGoldman Mar 21, 2019
f7e42eb
Disabling caching for the repository clone view
StanleyGoldman Mar 26, 2019
e6290ba
Merge remote-tracking branch 'origin/master' into feature/graphql-cac…
StanleyGoldman Mar 27, 2019
6c9874b
Fixes needed after merge
StanleyGoldman Mar 27, 2019
895bbb2
Fixing some tests
StanleyGoldman Mar 27, 2019
098cd3f
Fixing tests
StanleyGoldman Mar 28, 2019
0f46686
Fixing tests
StanleyGoldman Mar 28, 2019
415e7dd
Changing code to use Task.Run over TaskScheduler.Default
StanleyGoldman Apr 4, 2019
c8ace03
Merge remote-tracking branch 'origin/master' into feature/graphql-cac…
StanleyGoldman Apr 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Disabling caching for the repository clone view
  • Loading branch information
StanleyGoldman committed Mar 26, 2019
commit f7e42eb68cf45ffe10fbc50ae47ad9364793833d
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public SelectPageViewModelDesigner()
public ICollectionView ItemsView { get; }
public IRepositoryItemViewModel SelectedItem { get; set; }
public RepositoryModel Repository { get; }
public ReactiveCommand<Unit, Unit> Refresh { get; }

public void Initialize(IConnection connection)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class RepositorySelectViewModel : ViewModelBase, IRepositorySelectViewMod
ICollectionView itemsView;
ObservableAsPropertyHelper<RepositoryModel> repository;
IRepositoryItemViewModel selectedItem;
static bool firstLoad = true;

[ImportingConstructor]
public RepositorySelectViewModel(IRepositoryCloneService service, IGitHubContextService gitHubContextService)
Expand All @@ -58,12 +57,6 @@ public RepositorySelectViewModel(IRepositoryCloneService service, IGitHubContext
.ToProperty(this, x => x.Repository);

this.WhenAnyValue(x => x.Filter).Subscribe(_ => ItemsView?.Refresh());

Refresh = ReactiveCommand.CreateFromTask(async () =>
{
await this.LoadItems(true);
return Unit.Default;
});
}

public Exception Error
Expand Down Expand Up @@ -108,8 +101,6 @@ public IRepositoryItemViewModel SelectedItem
set => this.RaiseAndSetIfChanged(ref selectedItem, value);
}

public ReactiveCommand<Unit, Unit> Refresh { get; }

public RepositoryModel Repository => repository.Value;

public void Initialize(IConnection connection)
Expand All @@ -122,8 +113,7 @@ public void Initialize(IConnection connection)

public async Task Activate()
{
await this.LoadItems(firstLoad);
firstLoad = false;
await this.LoadItems(true);
}

static string GroupName(KeyValuePair<string, IReadOnlyList<RepositoryListItemModel>> group, int max)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public interface IRepositorySelectViewModel : IRepositoryCloneTabViewModel
IReadOnlyList<IRepositoryItemViewModel> Items { get; }
ICollectionView ItemsView { get; }
IRepositoryItemViewModel SelectedItem { get; set; }
ReactiveCommand<Unit, Unit> Refresh { get; }

void Initialize(IConnection connection);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
</UserControl.Resources>

<DockPanel>
<DockPanel DockPanel.Dock="Top" Margin="0,4">
<Button DockPanel.Dock="Right" Command="{Binding Refresh}">Refresh</Button>
<ghfvs:PromptTextBox PromptText="Search or enter a URL"
Text="{Binding Filter, UpdateSourceTrigger=PropertyChanged, Delay=300}"/>
</DockPanel>
<ghfvs:PromptTextBox DockPanel.Dock="Top"
Margin="0,4"
PromptText="Search or enter a URL"
Text="{Binding Filter, UpdateSourceTrigger=PropertyChanged, Delay=300}"/>

<Grid>
<ListView BorderThickness="0"
ItemsSource="{Binding ItemsView}"
Expand Down
0