From c6716e030c02f316b887c1d3ee4b443aa3ab6afd Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 1 Apr 2022 00:23:19 +0200 Subject: Update dependencies (#1784) --- .../mattermost/mattermost-server/v6/model/utils.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'vendor/github.com/mattermost/mattermost-server/v6/model/utils.go') diff --git a/vendor/github.com/mattermost/mattermost-server/v6/model/utils.go b/vendor/github.com/mattermost/mattermost-server/v6/model/utils.go index c88d9100..4a6f633e 100644 --- a/vendor/github.com/mattermost/mattermost-server/v6/model/utils.go +++ b/vendor/github.com/mattermost/mattermost-server/v6/model/utils.go @@ -132,6 +132,24 @@ func (m StringMap) Value() (driver.Value, error) { return string(j), err } +func (StringMap) ImplementsGraphQLType(name string) bool { + return name == "StringMap" +} + +func (m StringMap) MarshalJSON() ([]byte, error) { + return json.Marshal((map[string]string)(m)) +} + +func (m *StringMap) UnmarshalGraphQL(input interface{}) error { + json, ok := input.(map[string]string) + if !ok { + return errors.New("wrong type") + } + + *m = json + return nil +} + func (si *StringInterface) Scan(value interface{}) error { if value == nil { return nil -- cgit v1.2.3