diff options
author | Wim <wim@42.be> | 2022-04-01 00:23:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-01 00:23:19 +0200 |
commit | c6716e030c02f316b887c1d3ee4b443aa3ab6afd (patch) | |
tree | 470461fe2d29662e7a69834ed21fce30beed65ab /vendor/github.com/mattermost/mattermost-server/v6/model/utils.go | |
parent | 4ab72acec656dafd304f88359b509b1f27c06604 (diff) | |
download | matterbridge-msglm-c6716e030c02f316b887c1d3ee4b443aa3ab6afd.tar.gz matterbridge-msglm-c6716e030c02f316b887c1d3ee4b443aa3ab6afd.tar.bz2 matterbridge-msglm-c6716e030c02f316b887c1d3ee4b443aa3ab6afd.zip |
Update dependencies (#1784)
Diffstat (limited to 'vendor/github.com/mattermost/mattermost-server/v6/model/utils.go')
-rw-r--r-- | vendor/github.com/mattermost/mattermost-server/v6/model/utils.go | 18 |
1 files changed, 18 insertions, 0 deletions
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 |