Add missing field "sortOrder" to graphQL schema (#20956)

* Add missing field "sortOrder" to graphQL schema

* Add test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Daniel Espino García
2022-09-08 09:30:53 +02:00
коммит произвёл GitHub
родитель 1fc5fcd900
Коммит 56bf9cec50
3 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@@ -27,6 +27,7 @@ func TestGraphQLSidebarCategories(t *testing.T) {
Sorting model.SidebarCategorySorting `json:"sorting"`
ChannelIDs []string `json:"channelIds"`
TeamID string `json:"teamId"`
SortOrder int64 `json:"sortOrder"`
} `json:"sidebarCategories"`
}
@@ -39,6 +40,7 @@ func TestGraphQLSidebarCategories(t *testing.T) {
displayName
sorting
channelIds
sortOrder
}
}
`,
@@ -69,6 +71,7 @@ func TestGraphQLSidebarCategories(t *testing.T) {
assert.Equal(t, categories.Categories[i].DisplayName, q.SidebarCategories[i].DisplayName)
assert.Equal(t, categories.Categories[i].Sorting, q.SidebarCategories[i].Sorting)
assert.Equal(t, categories.Categories[i].ChannelIds(), q.SidebarCategories[i].ChannelIDs)
assert.Equal(t, categories.Categories[i].SortOrder, q.SidebarCategories[i].SortOrder)
}
input = graphQLInput{
@@ -80,6 +83,7 @@ func TestGraphQLSidebarCategories(t *testing.T) {
displayName
sorting
channelIds
sortOrder
}
}
`,
@@ -114,6 +118,7 @@ func TestGraphQLSidebarCategories(t *testing.T) {
sorting
channelIds
teamId
sortOrder
}
}
`,

Просмотреть файл

@@ -203,6 +203,7 @@ type SidebarCategory {
collapsed: Boolean!
teamId: String!
channelIds: [String!]!
sortOrder: Float!
}
# Deliberately leaving out teamMembers.

Просмотреть файл

@@ -124,3 +124,7 @@ func (t *SidebarCategorySorting) UnmarshalGraphQL(input any) error {
*t = SidebarCategorySorting(chType)
return nil
}
func (t *SidebarCategory) SortOrder_() float64 {
return float64(t.SortOrder)
}