~sircmpwn/meta.sr.ht

1e2b599c0161fc460c0dcee0ea1fd10f960e6f49 — Drew DeVault a month ago 0222a3d 0.44.3
API: make SSHKey { lastUsed } nullable
3 files changed, 10 insertions(+), 16 deletions(-)

M api/graph/api/generated.go
M api/graph/model/sshkey.go
M api/graph/schema.graphqls
M api/graph/api/generated.go => api/graph/api/generated.go +3 -9
@@ 824,7 824,7 @@ type User implements Entity {
type SSHKey {
  id: Int!
  created: Time!
  lastUsed: Time!
  lastUsed: Time
  user: User!
  key: String!
  fingerprint: String!


@@ 2721,14 2721,11 @@ func (ec *executionContext) _SSHKey_lastUsed(ctx context.Context, field graphql.
		return graphql.Null
	}
	if resTmp == nil {
		if !graphql.HasFieldError(ctx, fc) {
			ec.Errorf(ctx, "must not be null")
		}
		return graphql.Null
	}
	res := resTmp.(time.Time)
	res := resTmp.(*time.Time)
	fc.Result = res
	return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res)
	return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res)
}

func (ec *executionContext) _SSHKey_user(ctx context.Context, field graphql.CollectedField, obj *model1.SSHKey) (ret graphql.Marshaler) {


@@ 5036,9 5033,6 @@ func (ec *executionContext) _SSHKey(ctx context.Context, sel ast.SelectionSet, o
			}
		case "lastUsed":
			out.Values[i] = ec._SSHKey_lastUsed(ctx, field, obj)
			if out.Values[i] == graphql.Null {
				atomic.AddUint32(&invalids, 1)
			}
		case "user":
			field := field
			out.Concurrently(i, func() (res graphql.Marshaler) {

M api/graph/model/sshkey.go => api/graph/model/sshkey.go +6 -6
@@ 13,12 13,12 @@ import (
)

type SSHKey struct {
	ID          int       `json:"id"`
	Created     time.Time `json:"created"`
	LastUsed    time.Time `json:"lastUsed"`
	Key         string    `json:"key"`
	Fingerprint string    `json:"fingerprint"`
	Comment     *string   `json:"comment"`
	ID          int        `json:"id"`
	Created     time.Time  `json:"created"`
	LastUsed    *time.Time `json:"lastUsed"`
	Key         string     `json:"key"`
	Fingerprint string     `json:"fingerprint"`
	Comment     *string    `json:"comment"`

	UserID int


M api/graph/schema.graphqls => api/graph/schema.graphqls +1 -1
@@ 55,7 55,7 @@ type User implements Entity {
type SSHKey {
  id: Int!
  created: Time!
  lastUsed: Time!
  lastUsed: Time
  user: User!
  key: String!
  fingerprint: String!