Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
75b60a84
Commit
75b60a84
authored
1 year ago
by
Hangzhi Yu
Browse files
Options
Downloads
Patches
Plain Diff
Enable gql batch queying
parent
f91162e9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1252
Resolve "Improve performance of polling queries"
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.rst
+1
-0
1 addition, 0 deletions
CHANGELOG.rst
aleksis/core/frontend/app/apollo.js
+6
-2
6 additions, 2 deletions
aleksis/core/frontend/app/apollo.js
aleksis/core/settings.py
+1
-0
1 addition, 0 deletions
aleksis/core/settings.py
aleksis/core/urls.py
+1
-1
1 addition, 1 deletion
aleksis/core/urls.py
with
9 additions
and
3 deletions
CHANGELOG.rst
+
1
−
0
View file @
75b60a84
...
...
@@ -34,6 +34,7 @@ Added
* Provide API endpoint for system status.
* [Dev] UpdateIndicator Vue Component to display the status of interactive pages
* [Dev] DeleteDialog Vue Component to unify item deletion in the new frontend
* Use build-in mechanism in Apollo for GraphQL batch querying.
Changed
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/frontend/app/apollo.js
+
6
−
2
View file @
75b60a84
...
...
@@ -2,11 +2,12 @@
* Configuration for Apollo provider, client, and caches.
*/
import
{
ApolloClient
,
HttpLink
,
from
}
from
"
@/apollo-boost
"
;
import
{
ApolloClient
,
from
}
from
"
@/apollo-boost
"
;
import
{
RetryLink
}
from
"
@/apollo-link-retry
"
;
import
{
persistCache
,
LocalStorageWrapper
}
from
"
@/apollo3-cache-persist
"
;
import
{
InMemoryCache
}
from
"
@/apollo-cache-inmemory
"
;
import
{
BatchHttpLink
}
from
"
@/apollo-link-batch-http
"
;
// Cache for GraphQL query results in memory and persistent across sessions
const
cache
=
new
InMemoryCache
();
...
...
@@ -33,14 +34,17 @@ const links = [
// Automatically retry failed queries
new
RetryLink
(),
// Finally, the HTTP link to the real backend (Django)
new
HttpLink
({
new
Batch
HttpLink
({
uri
:
getGraphqlURL
(),
batchInterval
:
200
,
batchDebounce
:
true
,
}),
];
/** Upstream Apollo GraphQL client */
const
apolloClient
=
new
ApolloClient
({
cache
,
shouldBatch
:
true
,
link
:
from
(
links
),
});
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/settings.py
+
1
−
0
View file @
75b60a84
...
...
@@ -587,6 +587,7 @@ YARN_INSTALLED_APPS = [
"
@iconify/json@^2.1.30
"
,
"
@mdi/font@^7.2.96
"
,
"
apollo-boost@^0.4.9
"
,
"
apollo-link-batch-http@^1.2.14
"
,
"
apollo-link-retry@^2.2.16
"
,
"
apollo3-cache-persist@^0.14.1
"
,
"
deepmerge@^4.2.2
"
,
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/urls.py
+
1
−
1
View file @
75b60a84
...
...
@@ -27,7 +27,7 @@ urlpatterns = [
path
(
"
__icons__/
"
,
include
(
"
dj_iconify.urls
"
)),
path
(
"
graphql/
"
,
csrf_exempt
(
views
.
LoggingGraphQLView
.
as_view
(
graphiql
=
True
)),
csrf_exempt
(
views
.
LoggingGraphQLView
.
as_view
(
batch
=
True
)),
name
=
"
graphql
"
,
),
path
(
"
logo
"
,
force_maintenance_mode_off
(
views
.
LogoView
.
as_view
()),
name
=
"
logo
"
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment