diff --git a/go.mod b/go.mod index 32373d9..17f7e73 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( codeberg.org/eventsourced/pg/v2 v2.4.0 codeberg.org/messaging/go-messaging-amqp v0.0.7 codeberg.org/messaging/messaging v0.0.5 - github.com/99designs/gqlgen v0.17.97 + github.com/99designs/gqlgen v0.17.98 github.com/DATA-DOG/go-sqlmock v1.5.2 github.com/Khan/genqlient v0.8.1 github.com/alecthomas/kong v1.16.1 diff --git a/go.sum b/go.sum index 0c83955..e1194b2 100644 --- a/go.sum +++ b/go.sum @@ -13,8 +13,8 @@ codeberg.org/messaging/messaging/tck v0.0.3/go.mod h1:RiOsKXGAhNQK2STBVYGjhN0CFt filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc= -github.com/99designs/gqlgen v0.17.97 h1:Dv4OZ+Mvt38+1cemFYatThs3Y3tq2fjuV2OFWq2R7kc= -github.com/99designs/gqlgen v0.17.97/go.mod h1:Fk3sbEOHsiIkcmUhhTxe/Jmm3oXKDgc5L70P0rWOljw= +github.com/99designs/gqlgen v0.17.98 h1:t7UTlygkXMx1tJmKyR0LxttcufXnJ7fF6fAaeHSofAc= +github.com/99designs/gqlgen v0.17.98/go.mod h1:tIoiUl+cgIT7nayvObZkKDgplxd1pHcUAmEXAyv+8f4= github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/Khan/genqlient v0.8.1 h1:wtOCc8N9rNynRLXN3k3CnfzheCUNKBcvXmVv5zt6WCs= diff --git a/graph/generated/generated.go b/graph/generated/generated.go index a74d80f..a182b2c 100644 --- a/graph/generated/generated.go +++ b/graph/generated/generated.go @@ -1032,8 +1032,8 @@ func (ec *executionContext) field___Directive_args_args(ctx context.Context, raw var err error args := map[string]any{} arg0, err := graphql.ProcessArgField(ctx, rawArgs, "includeDeprecated", - func(ctx context.Context, v any) (*bool, error) { - return ec.unmarshalOBoolean2ᚖbool(ctx, v) + func(ctx context.Context, v any) (bool, error) { + return ec.unmarshalOBoolean2bool(ctx, v) }) if err != nil { return nil, err @@ -1046,8 +1046,8 @@ func (ec *executionContext) field___Field_args_args(ctx context.Context, rawArgs var err error args := map[string]any{} arg0, err := graphql.ProcessArgField(ctx, rawArgs, "includeDeprecated", - func(ctx context.Context, v any) (*bool, error) { - return ec.unmarshalOBoolean2ᚖbool(ctx, v) + func(ctx context.Context, v any) (bool, error) { + return ec.unmarshalOBoolean2bool(ctx, v) }) if err != nil { return nil, err @@ -1084,6 +1084,20 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg return args, nil } +func (ec *executionContext) field___Type_inputFields_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := graphql.ProcessArgField(ctx, rawArgs, "includeDeprecated", + func(ctx context.Context, v any) (bool, error) { + return ec.unmarshalOBoolean2bool(ctx, v) + }) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} + // endregion ***************************** args.gotpl ***************************** // region **************************** field.gotpl ***************************** @@ -2031,10 +2045,10 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C }, nil, func(ctx context.Context, selections ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, selections, v) + return ec.marshalN__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, selections, v) }, true, - false, + true, ) } func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -2645,7 +2659,8 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return ec.fieldContext___Directive_args(ctx, field) }, func(ctx context.Context) (any, error) { - return obj.Args, nil + fc := graphql.GetFieldContext(ctx) + return obj.VisibleArgs(fc.Args["includeDeprecated"].(bool)), nil }, nil, func(ctx context.Context, selections ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { @@ -2659,7 +2674,7 @@ func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, f fc = &graphql.FieldContext{ Object: "__Directive", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return ec.childFields___InputValue(ctx, field) @@ -2826,7 +2841,8 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return ec.fieldContext___Field_args(ctx, field) }, func(ctx context.Context) (any, error) { - return obj.Args, nil + fc := graphql.GetFieldContext(ctx) + return obj.VisibleArgs(fc.Args["includeDeprecated"].(bool)), nil }, nil, func(ctx context.Context, selections ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { @@ -2840,7 +2856,7 @@ func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field fc = &graphql.FieldContext{ Object: "__Field", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return ec.childFields___InputValue(ctx, field) @@ -3521,7 +3537,8 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return ec.fieldContext___Type_inputFields(ctx, field) }, func(ctx context.Context) (any, error) { - return obj.InputFields(), nil + fc := graphql.GetFieldContext(ctx) + return obj.VisibleInputFields(fc.Args["includeDeprecated"].(bool)), nil }, nil, func(ctx context.Context, selections ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { @@ -3531,7 +3548,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph false, ) } -func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -3541,6 +3558,17 @@ func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, f return ec.childFields___InputValue(ctx, field) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_inputFields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } @@ -4021,7 +4049,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Query___schema(ctx, field) }) - if out.Values[i] == graphql.RequiredNull { + if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } default: @@ -4961,6 +4989,14 @@ func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋg return ret } +func (ec *executionContext) marshalN__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + graphql.AddInvalidNullError(ctx, "__Schema!") + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { return ec.___Type(ctx, sel, &v) } @@ -5116,13 +5152,6 @@ func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋg return ret } -func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec.___Schema(ctx, sel, v) -} - func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { if v == nil { return graphql.Null