fix: rename title -> event_description

This commit is contained in:
Lakhan Samani
2023-03-26 07:48:06 +05:30
parent deaf1e2ff7
commit a38e9d4e6c
14 changed files with 153 additions and 149 deletions

View File

@@ -275,14 +275,14 @@ type ComplexityRoot struct {
}
Webhook struct {
CreatedAt func(childComplexity int) int
Enabled func(childComplexity int) int
Endpoint func(childComplexity int) int
EventName func(childComplexity int) int
Headers func(childComplexity int) int
ID func(childComplexity int) int
Title func(childComplexity int) int
UpdatedAt func(childComplexity int) int
CreatedAt func(childComplexity int) int
Enabled func(childComplexity int) int
Endpoint func(childComplexity int) int
EventDescription func(childComplexity int) int
EventName func(childComplexity int) int
Headers func(childComplexity int) int
ID func(childComplexity int) int
UpdatedAt func(childComplexity int) int
}
WebhookLog struct {
@@ -1834,6 +1834,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
return e.complexity.Webhook.Endpoint(childComplexity), true
case "Webhook.event_description":
if e.complexity.Webhook.EventDescription == nil {
break
}
return e.complexity.Webhook.EventDescription(childComplexity), true
case "Webhook.event_name":
if e.complexity.Webhook.EventName == nil {
break
@@ -1855,13 +1862,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
return e.complexity.Webhook.ID(childComplexity), true
case "Webhook.title":
if e.complexity.Webhook.Title == nil {
break
}
return e.complexity.Webhook.Title(childComplexity), true
case "Webhook.updated_at":
if e.complexity.Webhook.UpdatedAt == nil {
break
@@ -2218,8 +2218,8 @@ type GenerateJWTKeysResponse {
type Webhook {
id: ID!
title: String
event_name: String
event_description: String
endpoint: String
enabled: Boolean
headers: Map
@@ -2509,8 +2509,8 @@ input ListWebhookLogRequest {
}
input AddWebhookRequest {
title: String!
event_name: String!
event_description: String
endpoint: String!
enabled: Boolean!
headers: Map
@@ -2518,8 +2518,8 @@ input AddWebhookRequest {
input UpdateWebhookRequest {
id: ID!
title: String
event_name: String
event_description: String
endpoint: String
enabled: Boolean
headers: Map
@@ -10152,10 +10152,10 @@ func (ec *executionContext) fieldContext_Query__webhook(ctx context.Context, fie
switch field.Name {
case "id":
return ec.fieldContext_Webhook_id(ctx, field)
case "title":
return ec.fieldContext_Webhook_title(ctx, field)
case "event_name":
return ec.fieldContext_Webhook_event_name(ctx, field)
case "event_description":
return ec.fieldContext_Webhook_event_description(ctx, field)
case "endpoint":
return ec.fieldContext_Webhook_endpoint(ctx, field)
case "enabled":
@@ -12173,47 +12173,6 @@ func (ec *executionContext) fieldContext_Webhook_id(ctx context.Context, field g
return fc, nil
}
func (ec *executionContext) _Webhook_title(ctx context.Context, field graphql.CollectedField, obj *model.Webhook) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Webhook_title(ctx, field)
if err != nil {
return graphql.Null
}
ctx = graphql.WithFieldContext(ctx, fc)
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = graphql.Null
}
}()
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
ctx = rctx // use context from middleware stack in children
return obj.Title, nil
})
if err != nil {
ec.Error(ctx, err)
return graphql.Null
}
if resTmp == nil {
return graphql.Null
}
res := resTmp.(*string)
fc.Result = res
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_Webhook_title(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Webhook",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Webhook_event_name(ctx context.Context, field graphql.CollectedField, obj *model.Webhook) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Webhook_event_name(ctx, field)
if err != nil {
@@ -12255,6 +12214,47 @@ func (ec *executionContext) fieldContext_Webhook_event_name(ctx context.Context,
return fc, nil
}
func (ec *executionContext) _Webhook_event_description(ctx context.Context, field graphql.CollectedField, obj *model.Webhook) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Webhook_event_description(ctx, field)
if err != nil {
return graphql.Null
}
ctx = graphql.WithFieldContext(ctx, fc)
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = graphql.Null
}
}()
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
ctx = rctx // use context from middleware stack in children
return obj.EventDescription, nil
})
if err != nil {
ec.Error(ctx, err)
return graphql.Null
}
if resTmp == nil {
return graphql.Null
}
res := resTmp.(*string)
fc.Result = res
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_Webhook_event_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Webhook",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Webhook_endpoint(ctx context.Context, field graphql.CollectedField, obj *model.Webhook) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Webhook_endpoint(ctx, field)
if err != nil {
@@ -12959,10 +12959,10 @@ func (ec *executionContext) fieldContext_Webhooks_webhooks(ctx context.Context,
switch field.Name {
case "id":
return ec.fieldContext_Webhook_id(ctx, field)
case "title":
return ec.fieldContext_Webhook_title(ctx, field)
case "event_name":
return ec.fieldContext_Webhook_event_name(ctx, field)
case "event_description":
return ec.fieldContext_Webhook_event_description(ctx, field)
case "endpoint":
return ec.fieldContext_Webhook_endpoint(ctx, field)
case "enabled":
@@ -14812,21 +14812,13 @@ func (ec *executionContext) unmarshalInputAddWebhookRequest(ctx context.Context,
asMap[k] = v
}
fieldsInOrder := [...]string{"title", "event_name", "endpoint", "enabled", "headers"}
fieldsInOrder := [...]string{"event_name", "event_description", "endpoint", "enabled", "headers"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
continue
}
switch k {
case "title":
var err error
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title"))
it.Title, err = ec.unmarshalNString2string(ctx, v)
if err != nil {
return it, err
}
case "event_name":
var err error
@@ -14835,6 +14827,14 @@ func (ec *executionContext) unmarshalInputAddWebhookRequest(ctx context.Context,
if err != nil {
return it, err
}
case "event_description":
var err error
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("event_description"))
it.EventDescription, err = ec.unmarshalOString2ᚖstring(ctx, v)
if err != nil {
return it, err
}
case "endpoint":
var err error
@@ -16676,7 +16676,7 @@ func (ec *executionContext) unmarshalInputUpdateWebhookRequest(ctx context.Conte
asMap[k] = v
}
fieldsInOrder := [...]string{"id", "title", "event_name", "endpoint", "enabled", "headers"}
fieldsInOrder := [...]string{"id", "event_name", "event_description", "endpoint", "enabled", "headers"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
@@ -16691,14 +16691,6 @@ func (ec *executionContext) unmarshalInputUpdateWebhookRequest(ctx context.Conte
if err != nil {
return it, err
}
case "title":
var err error
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title"))
it.Title, err = ec.unmarshalOString2ᚖstring(ctx, v)
if err != nil {
return it, err
}
case "event_name":
var err error
@@ -16707,6 +16699,14 @@ func (ec *executionContext) unmarshalInputUpdateWebhookRequest(ctx context.Conte
if err != nil {
return it, err
}
case "event_description":
var err error
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("event_description"))
it.EventDescription, err = ec.unmarshalOString2ᚖstring(ctx, v)
if err != nil {
return it, err
}
case "endpoint":
var err error
@@ -18581,14 +18581,14 @@ func (ec *executionContext) _Webhook(ctx context.Context, sel ast.SelectionSet,
if out.Values[i] == graphql.Null {
invalids++
}
case "title":
out.Values[i] = ec._Webhook_title(ctx, field, obj)
case "event_name":
out.Values[i] = ec._Webhook_event_name(ctx, field, obj)
case "event_description":
out.Values[i] = ec._Webhook_event_description(ctx, field, obj)
case "endpoint":
out.Values[i] = ec._Webhook_endpoint(ctx, field, obj)

View File

@@ -10,11 +10,11 @@ type AddEmailTemplateRequest struct {
}
type AddWebhookRequest struct {
Title string `json:"title"`
EventName string `json:"event_name"`
Endpoint string `json:"endpoint"`
Enabled bool `json:"enabled"`
Headers map[string]interface{} `json:"headers"`
EventName string `json:"event_name"`
EventDescription *string `json:"event_description"`
Endpoint string `json:"endpoint"`
Enabled bool `json:"enabled"`
Headers map[string]interface{} `json:"headers"`
}
type AdminLoginInput struct {
@@ -388,12 +388,12 @@ type UpdateUserInput struct {
}
type UpdateWebhookRequest struct {
ID string `json:"id"`
Title *string `json:"title"`
EventName *string `json:"event_name"`
Endpoint *string `json:"endpoint"`
Enabled *bool `json:"enabled"`
Headers map[string]interface{} `json:"headers"`
ID string `json:"id"`
EventName *string `json:"event_name"`
EventDescription *string `json:"event_description"`
Endpoint *string `json:"endpoint"`
Enabled *bool `json:"enabled"`
Headers map[string]interface{} `json:"headers"`
}
type User struct {
@@ -463,14 +463,14 @@ type VerifyOTPRequest struct {
}
type Webhook struct {
ID string `json:"id"`
Title *string `json:"title"`
EventName *string `json:"event_name"`
Endpoint *string `json:"endpoint"`
Enabled *bool `json:"enabled"`
Headers map[string]interface{} `json:"headers"`
CreatedAt *int64 `json:"created_at"`
UpdatedAt *int64 `json:"updated_at"`
ID string `json:"id"`
EventName *string `json:"event_name"`
EventDescription *string `json:"event_description"`
Endpoint *string `json:"endpoint"`
Enabled *bool `json:"enabled"`
Headers map[string]interface{} `json:"headers"`
CreatedAt *int64 `json:"created_at"`
UpdatedAt *int64 `json:"updated_at"`
}
type WebhookLog struct {

View File

@@ -168,8 +168,8 @@ type GenerateJWTKeysResponse {
type Webhook {
id: ID!
title: String
event_name: String
event_description: String
endpoint: String
enabled: Boolean
headers: Map
@@ -459,8 +459,8 @@ input ListWebhookLogRequest {
}
input AddWebhookRequest {
title: String!
event_name: String!
event_description: String
endpoint: String!
enabled: Boolean!
headers: Map
@@ -468,8 +468,8 @@ input AddWebhookRequest {
input UpdateWebhookRequest {
id: ID!
title: String
event_name: String
event_description: String
endpoint: String
enabled: Boolean
headers: Map