Merge branch 'fix-more-apollo-cache-issues' into 'master'

Fix more apollo cache issues

See merge request framasoft/mobilizon!638
This commit is contained in:
Thomas Citharel 2020-10-22 17:49:48 +02:00
commit 4296924617
14 changed files with 75 additions and 3 deletions

View file

@ -11,10 +11,12 @@ export const FETCH_PERSON = gql`
preferredUsername
suspended
avatar {
id
name
url
}
banner {
id
url
}
feedTokens {
@ -50,10 +52,12 @@ export const GET_PERSON = gql`
preferredUsername
suspended
avatar {
id
name
url
}
banner {
id
url
}
feedTokens {
@ -114,6 +118,7 @@ export const LIST_PROFILES = gql`
domain
name
avatar {
id
url
}
}
@ -137,6 +142,7 @@ export const CURRENT_ACTOR_CLIENT = gql`
currentActor @client {
id
avatar {
id
url
}
preferredUsername
@ -196,6 +202,7 @@ export const LOGGED_USER_PARTICIPATIONS = gql`
domain
summary
avatar {
id
url
}
}
@ -218,6 +225,7 @@ export const LOGGED_USER_PARTICIPATIONS = gql`
domain
summary
avatar {
id
url
}
}
@ -248,6 +256,7 @@ export const LOGGED_USER_DRAFTS = gql`
name
domain
avatar {
id
url
}
}
@ -279,6 +288,7 @@ export const LOGGED_USER_MEMBERSHIPS = gql`
domain
name
avatar {
id
url
}
organizedEvents {
@ -286,6 +296,7 @@ export const LOGGED_USER_MEMBERSHIPS = gql`
id
title
picture {
id
url
}
}
@ -298,6 +309,7 @@ export const LOGGED_USER_MEMBERSHIPS = gql`
domain
name
avatar {
id
url
}
}
@ -312,6 +324,7 @@ export const IDENTITIES = gql`
identities {
id
avatar {
id
url
}
preferredUsername
@ -335,6 +348,7 @@ export const PERSON_MEMBERSHIPS = gql`
name
domain
avatar {
id
url
}
}
@ -366,6 +380,7 @@ export const PERSON_MEMBERSHIPS_WITH_MEMBERS = gql`
name
domain
avatar {
id
url
}
members {
@ -379,6 +394,7 @@ export const PERSON_MEMBERSHIPS_WITH_MEMBERS = gql`
name
domain
avatar {
id
url
}
}
@ -416,6 +432,7 @@ export const CREATE_PERSON = gql`
name
summary
avatar {
id
url
}
}
@ -430,6 +447,7 @@ export const UPDATE_PERSON = gql`
name
summary
avatar {
id
url
}
}
@ -461,6 +479,7 @@ export const REGISTER_PERSON = gql`
name
summary
avatar {
id
url
}
}

View file

@ -11,6 +11,7 @@ export const COMMENT_FIELDS_FRAGMENT = gql`
local
actor {
avatar {
id
url
}
id

View file

@ -15,6 +15,7 @@ export const DISCUSSION_BASIC_FIELDS_FRAGMENT = gql`
preferredUsername
domain
avatar {
id
url
}
}
@ -38,6 +39,7 @@ export const DISCUSSION_FIELDS_FOR_REPLY_FRAGMENT = gql`
preferredUsername
domain
avatar {
id
url
}
}
@ -111,6 +113,7 @@ export const GET_DISCUSSION = gql`
actor {
id
avatar {
id
url
}
name
@ -161,6 +164,7 @@ export const DISCUSSION_COMMENT_CHANGED = gql`
name
domain
avatar {
id
url
}
}

View file

@ -6,6 +6,7 @@ const participantQuery = `
actor {
preferredUsername,
avatar {
id
url
},
name,
@ -102,6 +103,7 @@ export const FETCH_EVENT = gql`
}
organizerActor {
avatar {
id
url
},
preferredUsername,
@ -113,6 +115,7 @@ export const FETCH_EVENT = gql`
},
contacts {
avatar {
id
url,
}
preferredUsername,
@ -124,6 +127,7 @@ export const FETCH_EVENT = gql`
},
attributedTo {
avatar {
id
url,
}
preferredUsername,
@ -157,6 +161,7 @@ export const FETCH_EVENT = gql`
organizerActor {
id
avatar {
id
url,
},
preferredUsername,
@ -199,6 +204,7 @@ export const FETCH_EVENTS = gql`
organizerActor {
id,
avatar {
id
url
},
preferredUsername,
@ -207,6 +213,7 @@ export const FETCH_EVENTS = gql`
},
# attributedTo {
# avatar {
# id
# url
# },
# preferredUsername,
@ -295,11 +302,13 @@ export const CREATE_EVENT = gql`
url,
preferredUsername,
avatar {
id
url
}
},
organizerActor {
avatar {
id
url
},
preferredUsername,
@ -310,6 +319,7 @@ export const CREATE_EVENT = gql`
},
contacts {
avatar {
id
url
},
preferredUsername,
@ -406,11 +416,13 @@ export const EDIT_EVENT = gql`
url,
preferredUsername,
avatar {
id
url
}
},
contacts {
avatar {
id
url
},
preferredUsername,
@ -421,6 +433,7 @@ export const EDIT_EVENT = gql`
},
organizerActor {
avatar {
id
url
},
preferredUsername,

View file

@ -31,9 +31,11 @@ export const LIST_GROUPS = gql`
preferredUsername
suspended
avatar {
id
url
}
banner {
id
url
}
organizedEvents {
@ -74,9 +76,11 @@ export const GROUP_FIELDS_FRAGMENTS = gql`
originId
}
avatar {
id
url
}
banner {
id
url
}
organizedEvents(
@ -134,6 +138,7 @@ export const GROUP_FIELDS_FRAGMENTS = gql`
domain
preferredUsername
avatar {
id
url
}
}
@ -238,9 +243,11 @@ export const CREATE_GROUP = gql`
domain
summary
avatar {
id
url
}
banner {
id
url
}
}
@ -271,9 +278,11 @@ export const UPDATE_GROUP = gql`
name
summary
avatar {
id
url
}
banner {
id
url
}
}

View file

@ -10,6 +10,7 @@ export const MEMBER_FRAGMENT = gql`
domain
name
avatar {
id
url
}
}
@ -19,6 +20,7 @@ export const MEMBER_FRAGMENT = gql`
domain
name
avatar {
id
url
}
}
@ -70,6 +72,7 @@ export const GROUP_MEMBERS = gql`
domain
preferredUsername
avatar {
id
url
}
}

View file

@ -14,6 +14,7 @@ export const POST_FRAGMENT = gql`
name
domain
avatar {
id
url
}
}
@ -23,6 +24,7 @@ export const POST_FRAGMENT = gql`
name
domain
avatar {
id
url
}
}
@ -55,6 +57,7 @@ export const POST_BASIC_FIELDS = gql`
name
domain
avatar {
id
url
}
}
@ -64,6 +67,7 @@ export const POST_BASIC_FIELDS = gql`
name
domain
avatar {
id
url
}
}

View file

@ -10,6 +10,7 @@ export const REPORTS = gql`
domain
name
avatar {
id
url
}
}
@ -18,6 +19,7 @@ export const REPORTS = gql`
preferredUsername
name
avatar {
id
url
}
domain
@ -46,6 +48,7 @@ const REPORT_FRAGMENT = gql`
preferredUsername
name
avatar {
id
url
}
domain
@ -55,6 +58,7 @@ const REPORT_FRAGMENT = gql`
preferredUsername
name
avatar {
id
url
}
domain
@ -79,6 +83,7 @@ const REPORT_FRAGMENT = gql`
domain
name
avatar {
id
url
}
}
@ -91,6 +96,7 @@ const REPORT_FRAGMENT = gql`
preferredUsername
name
avatar {
id
url
}
}
@ -163,6 +169,7 @@ export const LOGS = gql`
preferredUsername
domain
avatar {
id
url
}
}

View file

@ -28,6 +28,7 @@ export const SEARCH_EVENTS = gql`
uuid
beginsOn
picture {
id
url
}
tags {
@ -47,6 +48,7 @@ export const SEARCH_GROUPS = gql`
elements {
id
avatar {
id
url
}
domain
@ -65,6 +67,7 @@ export const SEARCH_PERSONS = gql`
elements {
id
avatar {
id
url
}
domain

View file

@ -23,6 +23,7 @@ export const GET_TODO = gql`
domain
name
avatar {
id
url
}
}

View file

@ -22,6 +22,7 @@ export const VALIDATE_USER = gql`
preferredUsername
name
avatar {
id
url
}
}
@ -40,6 +41,7 @@ export const LOGGED_USER = gql`
preferredUsername
name
avatar {
id
url
}
}
@ -168,6 +170,7 @@ export const LIST_USERS = gql`
id
preferredUsername
avatar {
id
url
}
name
@ -202,6 +205,7 @@ export const GET_USER = gql`
preferredUsername
name
avatar {
id
url
}
}

View file

@ -1686,7 +1686,7 @@ defmodule Mobilizon.Actors do
method =
case type do
:remote_members -> &list_remote_members_for_group/3
:events -> &Events.list_organized_events_for_group/3
:events -> &Events.list_simple_organized_events_for_group/3
:posts -> &Mobilizon.Posts.get_posts_for_group/3
:resources -> &Mobilizon.Resources.get_resources_for_group/3
:todo_lists -> &Mobilizon.Todos.get_todo_lists_for_group/3

View file

@ -425,6 +425,10 @@ defmodule Mobilizon.Events do
|> Page.build_page(page, limit)
end
def list_simple_organized_events_for_group(%Actor{} = actor, page, limit) do
list_organized_events_for_group(actor, :all, nil, nil, page, limit)
end
@spec list_organized_events_for_group(
Actor.t(),
DateTime.t() | nil,
@ -1704,7 +1708,7 @@ defmodule Mobilizon.Events do
defp event_filter_visibility(query, :public) do
query
|> where(visibility: ^:public)
|> where(visibility: ^:public, draft: false)
end
defp event_filter_begins_on(query, nil, nil),

View file

@ -96,7 +96,7 @@ defmodule Mobilizon.Web.ActivityPub.ActorView do
end
defp fetch_collection(:events, actor, page) do
Events.list_organized_events_for_group(actor, page)
Events.list_simple_organized_events_for_group(actor, page)
end
defp fetch_collection(:todos, actor, page) do