Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wotwizard-ui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
wotwizard-ui
Commits
348607d5
Commit
348607d5
authored
3 years ago
by
Pierre-Jean CHANCELLIER
Browse files
Options
Downloads
Patches
Plain Diff
cache customisation for apollo
parent
6104bc35
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
graphql/index.js
+13
-1
13 additions, 1 deletion
graphql/index.js
pages/index.vue
+14
-8
14 additions, 8 deletions
pages/index.vue
with
27 additions
and
9 deletions
graphql/index.js
+
13
−
1
View file @
348607d5
...
@@ -16,7 +16,19 @@ export default ctx => {
...
@@ -16,7 +16,19 @@ export default ctx => {
})
})
const
link
=
from
([
ssrMiddleware
,
httpLink
])
const
link
=
from
([
ssrMiddleware
,
httpLink
])
const
cache
=
new
InMemoryCache
({
addTypename
:
false
})
const
cache
=
new
InMemoryCache
({
typePolicies
:
{
Event
:
{
keyFields
:
[
'
block
'
,[
'
bct
'
]]
},
EventId
:
{
keyFields
:
[
'
member
'
,[
'
hash
'
],
'
inOut
'
]
},
Identity
:
{
keyFields
:
[
'
hash
'
]
}
}
})
return
{
return
{
link
,
link
,
...
...
This diff is collapsed.
Click to expand it.
pages/index.vue
+
14
−
8
View file @
348607d5
...
@@ -45,7 +45,7 @@ export default {
...
@@ -45,7 +45,7 @@ export default {
query
:
gql
`query LastEvents($start: Int64, $end: Int64) {
query
:
gql
`query LastEvents($start: Int64, $end: Int64) {
membersCount(start: $start, end: $end) {
membersCount(start: $start, end: $end) {
idList {
idList {
id {
member :
id {
pubkey
pubkey
uid
uid
status
status
...
@@ -56,23 +56,29 @@ export default {
...
@@ -56,23 +56,29 @@ export default {
}
}
}
}
inOut
inOut
},
block {
bct
}
}
}
}
} `
,
} `
,
variables
(){
return
{
start
:
today
-
86400
*
2
,
end
:
today
}},
variables
(){
return
{
start
:
today
-
86400
*
2
,
end
:
today
}},
update
(
data
)
{
update
(
data
)
{
console
.
log
(
data
)
let
result
=
{
'
entrees
'
:[],
'
sorties
'
:[]}
let
result
=
{
'
entrees
'
:[],
'
sorties
'
:[]}
for
(
let
i
=
0
;
i
<
data
.
membersCount
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
data
.
membersCount
.
length
;
i
++
)
{
let
member
=
data
.
membersCount
[
i
].
idList
[
0
]
for
(
let
j
=
0
;
j
<
data
.
membersCount
[
i
].
idList
.
length
;
j
++
)
{
member
.
id
.
inOut
=
member
.
inOut
let
member
=
data
.
membersCount
[
i
].
idList
[
j
]
member
.
member
.
inOut
=
member
.
inOut
if
(
member
.
inOut
||
member
.
id
.
status
==
'
MEMBER
'
)
{
if
(
member
.
inOut
||
member
.
member
.
status
==
'
MEMBER
'
)
{
if
(
result
[
'
entrees
'
].
filter
(
function
(
e
)
{
return
e
.
hash
===
member
.
id
.
hash
;
}).
length
==
0
)
{
if
(
result
[
'
entrees
'
].
filter
(
function
(
e
)
{
return
e
.
hash
===
member
.
member
.
hash
;
}).
length
==
0
)
{
result
[
'
entrees
'
].
push
(
member
.
id
)
result
[
'
entrees
'
].
push
(
member
.
member
)
}
}
else
{
result
[
'
sorties
'
].
push
(
member
.
member
)
}
}
}
else
{
result
[
'
sorties
'
].
push
(
member
.
id
)
}
}
}
}
...
...
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