// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
package api
import (
"bytes"
"context"
"errors"
"fmt"
"strconv"
"sync"
"sync/atomic"
"time"
model1 "git.sr.ht/~sircmpwn/core-go/model"
"git.sr.ht/~sircmpwn/meta.sr.ht/api/graph/model"
"github.com/99designs/gqlgen/graphql"
"github.com/99designs/gqlgen/graphql/introspection"
gqlparser "github.com/vektah/gqlparser/v2"
"github.com/vektah/gqlparser/v2/ast"
)
// region ************************** generated!.gotpl **************************
// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema {
return &executableSchema{
resolvers: cfg.Resolvers,
directives: cfg.Directives,
complexity: cfg.Complexity,
}
}
type Config struct {
Resolvers ResolverRoot
Directives DirectiveRoot
Complexity ComplexityRoot
}
type ResolverRoot interface {
Mutation() MutationResolver
OAuthClient() OAuthClientResolver
OAuthGrant() OAuthGrantResolver
PGPKey() PGPKeyResolver
ProfileWebhookSubscription() ProfileWebhookSubscriptionResolver
Query() QueryResolver
SSHKey() SSHKeyResolver
User() UserResolver
WebhookDelivery() WebhookDeliveryResolver
}
type DirectiveRoot struct {
Access func(ctx context.Context, obj interface{}, next graphql.Resolver, scope model.AccessScope, kind model.AccessKind) (res interface{}, err error)
Anoninternal func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
Internal func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
Private func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
Scopehelp func(ctx context.Context, obj interface{}, next graphql.Resolver, details string) (res interface{}, err error)
}
type ComplexityRoot struct {
AuditLogCursor struct {
Cursor func(childComplexity int) int
Results func(childComplexity int) int
}
AuditLogEntry struct {
Created func(childComplexity int) int
Details func(childComplexity int) int
EventType func(childComplexity int) int
ID func(childComplexity int) int
IPAddress func(childComplexity int) int
}
Invoice struct {
Cents func(childComplexity int) int
Created func(childComplexity int) int
ID func(childComplexity int) int
Source func(childComplexity int) int
ValidThru func(childComplexity int) int
}
InvoiceCursor struct {
Cursor func(childComplexity int) int
Results func(childComplexity int) int
}
Mutation struct {
CreatePGPKey func(childComplexity int, key string) int
CreateSSHKey func(childComplexity int, key string) int
CreateWebhook func(childComplexity int, config model.ProfileWebhookInput) int
DeletePGPKey func(childComplexity int, id int) int
DeleteSSHKey func(childComplexity int, id int) int
DeleteWebhook func(childComplexity int, id int) int
IssueAuthorizationCode func(childComplexity int, clientUUID string, grants string) int
IssueOAuthGrant func(childComplexity int, authorization string, clientSecret string) int
IssuePersonalAccessToken func(childComplexity int, grants *string, comment *string) int
RegisterAccount func(childComplexity int, email string, username string, password string, pgpKey *string, invite *string) int
RegisterOAuthClient func(childComplexity int, redirectURI string, clientName string, clientDescription *string, clientURL *string) int
RevokeOAuthClient func(childComplexity int, uuid string) int
RevokeOAuthGrant func(childComplexity int, hash string) int
RevokePersonalAccessToken func(childComplexity int, id int) int
UpdateSSHKey func(childComplexity int, id int) int
UpdateUser func(childComplexity int, input map[string]interface{}) int
}
OAuthClient struct {
Description func(childComplexity int) int
ID func(childComplexity int) int
Name func(childComplexity int) int
Owner func(childComplexity int) int
RedirectURL func(childComplexity int) int
URL func(childComplexity int) int
UUID func(childComplexity int) int
}
OAuthClientRegistration struct {
Client func(childComplexity int) int
Secret func(childComplexity int) int
}
OAuthGrant struct {
Client func(childComplexity int) int
Expires func(childComplexity int) int
ID func(childComplexity int) int
Issued func(childComplexity int) int
TokenHash func(childComplexity int) int
}
OAuthGrantRegistration struct {
Grant func(childComplexity int) int
Grants func(childComplexity int) int
Secret func(childComplexity int) int
}
OAuthPersonalToken struct {
Comment func(childComplexity int) int
Expires func(childComplexity int) int
ID func(childComplexity int) int
Issued func(childComplexity int) int
}
OAuthPersonalTokenRegistration struct {
Secret func(childComplexity int) int
Token func(childComplexity int) int
}
PGPKey struct {
Created func(childComplexity int) int
Fingerprint func(childComplexity int) int
ID func(childComplexity int) int
Key func(childComplexity int) int
User func(childComplexity int) int
}
PGPKeyCursor struct {
Cursor func(childComplexity int) int
Results func(childComplexity int) int
}
PGPKeyEvent struct {
Date func(childComplexity int) int
Event func(childComplexity int) int
Key func(childComplexity int) int
UUID func(childComplexity int) int
}
ProfileUpdateEvent struct {
Date func(childComplexity int) int
Event func(childComplexity int) int
Profile func(childComplexity int) int
UUID func(childComplexity int) int
}
ProfileWebhookSubscription struct {
Client func(childComplexity int) int
Deliveries func(childComplexity int, cursor *model1.Cursor) int
Events func(childComplexity int) int
ID func(childComplexity int) int
Query func(childComplexity int) int
Sample func(childComplexity int, event *model.WebhookEvent) int
URL func(childComplexity int) int
}
Query struct {
AuditLog func(childComplexity int, cursor *model1.Cursor) int
Invoices func(childComplexity int, cursor *model1.Cursor) int
Me func(childComplexity int) int
OauthClientByID func(childComplexity int, id int) int
OauthClientByUUID func(childComplexity int, uuid string) int
OauthClients func(childComplexity int) int
OauthGrants func(childComplexity int) int
PGPKeyByFingerprint func(childComplexity int, fingerprint string) int
PersonalAccessTokens func(childComplexity int) int
ProfileWebhook func(childComplexity int, id int) int
ProfileWebhooks func(childComplexity int, cursor *model1.Cursor) int
SSHKeyByFingerprint func(childComplexity int, fingerprint string) int
TokenRevocationStatus func(childComplexity int, hash string, clientID *string) int
UserByEmail func(childComplexity int, email string) int
UserByID func(childComplexity int, id int) int
UserByName func(childComplexity int, username string) int
Version func(childComplexity int) int
Webhook func(childComplexity int) int
}
SSHKey struct {
Comment func(childComplexity int) int
Created func(childComplexity int) int
Fingerprint func(childComplexity int) int
ID func(childComplexity int) int
Key func(childComplexity int) int
LastUsed func(childComplexity int) int
User func(childComplexity int) int
}
SSHKeyCursor struct {
Cursor func(childComplexity int) int
Results func(childComplexity int) int
}
SSHKeyEvent struct {
Date func(childComplexity int) int
Event func(childComplexity int) int
Key func(childComplexity int) int
UUID func(childComplexity int) int
}
User struct {
Bio func(childComplexity int) int
CanonicalName func(childComplexity int) int
Created func(childComplexity int) int
Email func(childComplexity int) int
ID func(childComplexity int) int
Location func(childComplexity int) int
PGPKeys func(childComplexity int, cursor *model1.Cursor) int
SSHKeys func(childComplexity int, cursor *model1.Cursor) int
SuspensionNotice func(childComplexity int) int
URL func(childComplexity int) int
Updated func(childComplexity int) int
UserType func(childComplexity int) int
Username func(childComplexity int) int
}
Version struct {
DeprecationDate func(childComplexity int) int
Major func(childComplexity int) int
Minor func(childComplexity int) int
Patch func(childComplexity int) int
}
WebhookDelivery struct {
Date func(childComplexity int) int
Event func(childComplexity int) int
RequestBody func(childComplexity int) int
ResponseBody func(childComplexity int) int
ResponseHeaders func(childComplexity int) int
ResponseStatus func(childComplexity int) int
Subscription func(childComplexity int) int
UUID func(childComplexity int) int
}
WebhookDeliveryCursor struct {
Cursor func(childComplexity int) int
Results func(childComplexity int) int
}
WebhookSubscriptionCursor struct {
Cursor func(childComplexity int) int
Results func(childComplexity int) int
}
}
type MutationResolver interface {
UpdateUser(ctx context.Context, input map[string]interface{}) (*model.User, error)
CreatePGPKey(ctx context.Context, key string) (*model.PGPKey, error)
DeletePGPKey(ctx context.Context, id int) (*model.PGPKey, error)
CreateSSHKey(ctx context.Context, key string) (*model.SSHKey, error)
DeleteSSHKey(ctx context.Context, id int) (*model.SSHKey, error)
UpdateSSHKey(ctx context.Context, id int) (*model.SSHKey, error)
CreateWebhook(ctx context.Context, config model.ProfileWebhookInput) (model.WebhookSubscription, error)
DeleteWebhook(ctx context.Context, id int) (model.WebhookSubscription, error)
RegisterAccount(ctx context.Context, email string, username string, password string, pgpKey *string, invite *string) (*model.User, error)
RegisterOAuthClient(ctx context.Context, redirectURI string, clientName string, clientDescription *string, clientURL *string) (*model.OAuthClientRegistration, error)
RevokeOAuthClient(ctx context.Context, uuid string) (*model.OAuthClient, error)
RevokeOAuthGrant(ctx context.Context, hash string) (*model.OAuthGrant, error)
IssuePersonalAccessToken(ctx context.Context, grants *string, comment *string) (*model.OAuthPersonalTokenRegistration, error)
RevokePersonalAccessToken(ctx context.Context, id int) (*model.OAuthPersonalToken, error)
IssueAuthorizationCode(ctx context.Context, clientUUID string, grants string) (string, error)
IssueOAuthGrant(ctx context.Context, authorization string, clientSecret string) (*model.OAuthGrantRegistration, error)
}
type OAuthClientResolver interface {
Owner(ctx context.Context, obj *model.OAuthClient) (model.Entity, error)
}
type OAuthGrantResolver interface {
Client(ctx context.Context, obj *model.OAuthGrant) (*model.OAuthClient, error)
}
type PGPKeyResolver interface {
User(ctx context.Context, obj *model.PGPKey) (*model.User, error)
}
type ProfileWebhookSubscriptionResolver interface {
Client(ctx context.Context, obj *model.ProfileWebhookSubscription) (*model.OAuthClient, error)
Deliveries(ctx context.Context, obj *model.ProfileWebhookSubscription, cursor *model1.Cursor) (*model.WebhookDeliveryCursor, error)
Sample(ctx context.Context, obj *model.ProfileWebhookSubscription, event *model.WebhookEvent) (string, error)
}
type QueryResolver interface {
Version(ctx context.Context) (*model.Version, error)
Me(ctx context.Context) (*model.User, error)
UserByID(ctx context.Context, id int) (*model.User, error)
UserByName(ctx context.Context, username string) (*model.User, error)
UserByEmail(ctx context.Context, email string) (*model.User, error)
SSHKeyByFingerprint(ctx context.Context, fingerprint string) (*model.SSHKey, error)
PGPKeyByFingerprint(ctx context.Context, fingerprint string) (*model.PGPKey, error)
Invoices(ctx context.Context, cursor *model1.Cursor) (*model.InvoiceCursor, error)
AuditLog(ctx context.Context, cursor *model1.Cursor) (*model.AuditLogCursor, error)
ProfileWebhooks(ctx context.Context, cursor *model1.Cursor) (*model.WebhookSubscriptionCursor, error)
ProfileWebhook(ctx context.Context, id int) (model.WebhookSubscription, error)
Webhook(ctx context.Context) (model.WebhookPayload, error)
OauthGrants(ctx context.Context) ([]*model.OAuthGrant, error)
OauthClients(ctx context.Context) ([]*model.OAuthClient, error)
PersonalAccessTokens(ctx context.Context) ([]*model.OAuthPersonalToken, error)
OauthClientByID(ctx context.Context, id int) (*model.OAuthClient, error)
OauthClientByUUID(ctx context.Context, uuid string) (*model.OAuthClient, error)
TokenRevocationStatus(ctx context.Context, hash string, clientID *string) (bool, error)
}
type SSHKeyResolver interface {
User(ctx context.Context, obj *model.SSHKey) (*model.User, error)
}
type UserResolver interface {
SSHKeys(ctx context.Context, obj *model.User, cursor *model1.Cursor) (*model.SSHKeyCursor, error)
PGPKeys(ctx context.Context, obj *model.User, cursor *model1.Cursor) (*model.PGPKeyCursor, error)
}
type WebhookDeliveryResolver interface {
Subscription(ctx context.Context, obj *model.WebhookDelivery) (model.WebhookSubscription, error)
}
type executableSchema struct {
resolvers ResolverRoot
directives DirectiveRoot
complexity ComplexityRoot
}
func (e *executableSchema) Schema() *ast.Schema {
return parsedSchema
}
func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) {
ec := executionContext{nil, e}
_ = ec
switch typeName + "." + field {
case "AuditLogCursor.cursor":
if e.complexity.AuditLogCursor.Cursor == nil {
break
}
return e.complexity.AuditLogCursor.Cursor(childComplexity), true
case "AuditLogCursor.results":
if e.complexity.AuditLogCursor.Results == nil {
break
}
return e.complexity.AuditLogCursor.Results(childComplexity), true
case "AuditLogEntry.created":
if e.complexity.AuditLogEntry.Created == nil {
break
}
return e.complexity.AuditLogEntry.Created(childComplexity), true
case "AuditLogEntry.details":
if e.complexity.AuditLogEntry.Details == nil {
break
}
return e.complexity.AuditLogEntry.Details(childComplexity), true
case "AuditLogEntry.eventType":
if e.complexity.AuditLogEntry.EventType == nil {
break
}
return e.complexity.AuditLogEntry.EventType(childComplexity), true
case "AuditLogEntry.id":
if e.complexity.AuditLogEntry.ID == nil {
break
}
return e.complexity.AuditLogEntry.ID(childComplexity), true
case "AuditLogEntry.ipAddress":
if e.complexity.AuditLogEntry.IPAddress == nil {
break
}
return e.complexity.AuditLogEntry.IPAddress(childComplexity), true
case "Invoice.cents":
if e.complexity.Invoice.Cents == nil {
break
}
return e.complexity.Invoice.Cents(childComplexity), true
case "Invoice.created":
if e.complexity.Invoice.Created == nil {
break
}
return e.complexity.Invoice.Created(childComplexity), true
case "Invoice.id":
if e.complexity.Invoice.ID == nil {
break
}
return e.complexity.Invoice.ID(childComplexity), true
case "Invoice.source":
if e.complexity.Invoice.Source == nil {
break
}
return e.complexity.Invoice.Source(childComplexity), true
case "Invoice.validThru":
if e.complexity.Invoice.ValidThru == nil {
break
}
return e.complexity.Invoice.ValidThru(childComplexity), true
case "InvoiceCursor.cursor":
if e.complexity.InvoiceCursor.Cursor == nil {
break
}
return e.complexity.InvoiceCursor.Cursor(childComplexity), true
case "InvoiceCursor.results":
if e.complexity.InvoiceCursor.Results == nil {
break
}
return e.complexity.InvoiceCursor.Results(childComplexity), true
case "Mutation.createPGPKey":
if e.complexity.Mutation.CreatePGPKey == nil {
break
}
args, err := ec.field_Mutation_createPGPKey_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.CreatePGPKey(childComplexity, args["key"].(string)), true
case "Mutation.createSSHKey":
if e.complexity.Mutation.CreateSSHKey == nil {
break
}
args, err := ec.field_Mutation_createSSHKey_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.CreateSSHKey(childComplexity, args["key"].(string)), true
case "Mutation.createWebhook":
if e.complexity.Mutation.CreateWebhook == nil {
break
}
args, err := ec.field_Mutation_createWebhook_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.CreateWebhook(childComplexity, args["config"].(model.ProfileWebhookInput)), true
case "Mutation.deletePGPKey":
if e.complexity.Mutation.DeletePGPKey == nil {
break
}
args, err := ec.field_Mutation_deletePGPKey_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.DeletePGPKey(childComplexity, args["id"].(int)), true
case "Mutation.deleteSSHKey":
if e.complexity.Mutation.DeleteSSHKey == nil {
break
}
args, err := ec.field_Mutation_deleteSSHKey_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.DeleteSSHKey(childComplexity, args["id"].(int)), true
case "Mutation.deleteWebhook":
if e.complexity.Mutation.DeleteWebhook == nil {
break
}
args, err := ec.field_Mutation_deleteWebhook_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.DeleteWebhook(childComplexity, args["id"].(int)), true
case "Mutation.issueAuthorizationCode":
if e.complexity.Mutation.IssueAuthorizationCode == nil {
break
}
args, err := ec.field_Mutation_issueAuthorizationCode_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.IssueAuthorizationCode(childComplexity, args["clientUUID"].(string), args["grants"].(string)), true
case "Mutation.issueOAuthGrant":
if e.complexity.Mutation.IssueOAuthGrant == nil {
break
}
args, err := ec.field_Mutation_issueOAuthGrant_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.IssueOAuthGrant(childComplexity, args["authorization"].(string), args["clientSecret"].(string)), true
case "Mutation.issuePersonalAccessToken":
if e.complexity.Mutation.IssuePersonalAccessToken == nil {
break
}
args, err := ec.field_Mutation_issuePersonalAccessToken_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.IssuePersonalAccessToken(childComplexity, args["grants"].(*string), args["comment"].(*string)), true
case "Mutation.registerAccount":
if e.complexity.Mutation.RegisterAccount == nil {
break
}
args, err := ec.field_Mutation_registerAccount_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.RegisterAccount(childComplexity, args["email"].(string), args["username"].(string), args["password"].(string), args["pgpKey"].(*string), args["invite"].(*string)), true
case "Mutation.registerOAuthClient":
if e.complexity.Mutation.RegisterOAuthClient == nil {
break
}
args, err := ec.field_Mutation_registerOAuthClient_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.RegisterOAuthClient(childComplexity, args["redirectUri"].(string), args["clientName"].(string), args["clientDescription"].(*string), args["clientUrl"].(*string)), true
case "Mutation.revokeOAuthClient":
if e.complexity.Mutation.RevokeOAuthClient == nil {
break
}
args, err := ec.field_Mutation_revokeOAuthClient_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.RevokeOAuthClient(childComplexity, args["uuid"].(string)), true
case "Mutation.revokeOAuthGrant":
if e.complexity.Mutation.RevokeOAuthGrant == nil {
break
}
args, err := ec.field_Mutation_revokeOAuthGrant_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.RevokeOAuthGrant(childComplexity, args["hash"].(string)), true
case "Mutation.revokePersonalAccessToken":
if e.complexity.Mutation.RevokePersonalAccessToken == nil {
break
}
args, err := ec.field_Mutation_revokePersonalAccessToken_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.RevokePersonalAccessToken(childComplexity, args["id"].(int)), true
case "Mutation.updateSSHKey":
if e.complexity.Mutation.UpdateSSHKey == nil {
break
}
args, err := ec.field_Mutation_updateSSHKey_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.UpdateSSHKey(childComplexity, args["id"].(int)), true
case "Mutation.updateUser":
if e.complexity.Mutation.UpdateUser == nil {
break
}
args, err := ec.field_Mutation_updateUser_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.UpdateUser(childComplexity, args["input"].(map[string]interface{})), true
case "OAuthClient.description":
if e.complexity.OAuthClient.Description == nil {
break
}
return e.complexity.OAuthClient.Description(childComplexity), true
case "OAuthClient.id":
if e.complexity.OAuthClient.ID == nil {
break
}
return e.complexity.OAuthClient.ID(childComplexity), true
case "OAuthClient.name":
if e.complexity.OAuthClient.Name == nil {
break
}
return e.complexity.OAuthClient.Name(childComplexity), true
case "OAuthClient.owner":
if e.complexity.OAuthClient.Owner == nil {
break
}
return e.complexity.OAuthClient.Owner(childComplexity), true
case "OAuthClient.redirectUrl":
if e.complexity.OAuthClient.RedirectURL == nil {
break
}
return e.complexity.OAuthClient.RedirectURL(childComplexity), true
case "OAuthClient.url":
if e.complexity.OAuthClient.URL == nil {
break
}
return e.complexity.OAuthClient.URL(childComplexity), true
case "OAuthClient.uuid":
if e.complexity.OAuthClient.UUID == nil {
break
}
return e.complexity.OAuthClient.UUID(childComplexity), true
case "OAuthClientRegistration.client":
if e.complexity.OAuthClientRegistration.Client == nil {
break
}
return e.complexity.OAuthClientRegistration.Client(childComplexity), true
case "OAuthClientRegistration.secret":
if e.complexity.OAuthClientRegistration.Secret == nil {
break
}
return e.complexity.OAuthClientRegistration.Secret(childComplexity), true
case "OAuthGrant.client":
if e.complexity.OAuthGrant.Client == nil {
break
}
return e.complexity.OAuthGrant.Client(childComplexity), true
case "OAuthGrant.expires":
if e.complexity.OAuthGrant.Expires == nil {
break
}
return e.complexity.OAuthGrant.Expires(childComplexity), true
case "OAuthGrant.id":
if e.complexity.OAuthGrant.ID == nil {
break
}
return e.complexity.OAuthGrant.ID(childComplexity), true
case "OAuthGrant.issued":
if e.complexity.OAuthGrant.Issued == nil {
break
}
return e.complexity.OAuthGrant.Issued(childComplexity), true
case "OAuthGrant.tokenHash":
if e.complexity.OAuthGrant.TokenHash == nil {
break
}
return e.complexity.OAuthGrant.TokenHash(childComplexity), true
case "OAuthGrantRegistration.grant":
if e.complexity.OAuthGrantRegistration.Grant == nil {
break
}
return e.complexity.OAuthGrantRegistration.Grant(childComplexity), true
case "OAuthGrantRegistration.grants":
if e.complexity.OAuthGrantRegistration.Grants == nil {
break
}
return e.complexity.OAuthGrantRegistration.Grants(childComplexity), true
case "OAuthGrantRegistration.secret":
if e.complexity.OAuthGrantRegistration.Secret == nil {
break
}
return e.complexity.OAuthGrantRegistration.Secret(childComplexity), true
case "OAuthPersonalToken.comment":
if e.complexity.OAuthPersonalToken.Comment == nil {
break
}
return e.complexity.OAuthPersonalToken.Comment(childComplexity), true
case "OAuthPersonalToken.expires":
if e.complexity.OAuthPersonalToken.Expires == nil {
break
}
return e.complexity.OAuthPersonalToken.Expires(childComplexity), true
case "OAuthPersonalToken.id":
if e.complexity.OAuthPersonalToken.ID == nil {
break
}
return e.complexity.OAuthPersonalToken.ID(childComplexity), true
case "OAuthPersonalToken.issued":
if e.complexity.OAuthPersonalToken.Issued == nil {
break
}
return e.complexity.OAuthPersonalToken.Issued(childComplexity), true
case "OAuthPersonalTokenRegistration.secret":
if e.complexity.OAuthPersonalTokenRegistration.Secret == nil {
break
}
return e.complexity.OAuthPersonalTokenRegistration.Secret(childComplexity), true
case "OAuthPersonalTokenRegistration.token":
if e.complexity.OAuthPersonalTokenRegistration.Token == nil {
break
}
return e.complexity.OAuthPersonalTokenRegistration.Token(childComplexity), true
case "PGPKey.created":
if e.complexity.PGPKey.Created == nil {
break
}
return e.complexity.PGPKey.Created(childComplexity), true
case "PGPKey.fingerprint":
if e.complexity.PGPKey.Fingerprint == nil {
break
}
return e.complexity.PGPKey.Fingerprint(childComplexity), true
case "PGPKey.id":
if e.complexity.PGPKey.ID == nil {
break
}
return e.complexity.PGPKey.ID(childComplexity), true
case "PGPKey.key":
if e.complexity.PGPKey.Key == nil {
break
}
return e.complexity.PGPKey.Key(childComplexity), true
case "PGPKey.user":
if e.complexity.PGPKey.User == nil {
break
}
return e.complexity.PGPKey.User(childComplexity), true
case "PGPKeyCursor.cursor":
if e.complexity.PGPKeyCursor.Cursor == nil {
break
}
return e.complexity.PGPKeyCursor.Cursor(childComplexity), true
case "PGPKeyCursor.results":
if e.complexity.PGPKeyCursor.Results == nil {
break
}
return e.complexity.PGPKeyCursor.Results(childComplexity), true
case "PGPKeyEvent.date":
if e.complexity.PGPKeyEvent.Date == nil {
break
}
return e.complexity.PGPKeyEvent.Date(childComplexity), true
case "PGPKeyEvent.event":
if e.complexity.PGPKeyEvent.Event == nil {
break
}
return e.complexity.PGPKeyEvent.Event(childComplexity), true
case "PGPKeyEvent.key":
if e.complexity.PGPKeyEvent.Key == nil {
break
}
return e.complexity.PGPKeyEvent.Key(childComplexity), true
case "PGPKeyEvent.uuid":
if e.complexity.PGPKeyEvent.UUID == nil {
break
}
return e.complexity.PGPKeyEvent.UUID(childComplexity), true
case "ProfileUpdateEvent.date":
if e.complexity.ProfileUpdateEvent.Date == nil {
break
}
return e.complexity.ProfileUpdateEvent.Date(childComplexity), true
case "ProfileUpdateEvent.event":
if e.complexity.ProfileUpdateEvent.Event == nil {
break
}
return e.complexity.ProfileUpdateEvent.Event(childComplexity), true
case "ProfileUpdateEvent.profile":
if e.complexity.ProfileUpdateEvent.Profile == nil {
break
}
return e.complexity.ProfileUpdateEvent.Profile(childComplexity), true
case "ProfileUpdateEvent.uuid":
if e.complexity.ProfileUpdateEvent.UUID == nil {
break
}
return e.complexity.ProfileUpdateEvent.UUID(childComplexity), true
case "ProfileWebhookSubscription.client":
if e.complexity.ProfileWebhookSubscription.Client == nil {
break
}
return e.complexity.ProfileWebhookSubscription.Client(childComplexity), true
case "ProfileWebhookSubscription.deliveries":
if e.complexity.ProfileWebhookSubscription.Deliveries == nil {
break
}
args, err := ec.field_ProfileWebhookSubscription_deliveries_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.ProfileWebhookSubscription.Deliveries(childComplexity, args["cursor"].(*model1.Cursor)), true
case "ProfileWebhookSubscription.events":
if e.complexity.ProfileWebhookSubscription.Events == nil {
break
}
return e.complexity.ProfileWebhookSubscription.Events(childComplexity), true
case "ProfileWebhookSubscription.id":
if e.complexity.ProfileWebhookSubscription.ID == nil {
break
}
return e.complexity.ProfileWebhookSubscription.ID(childComplexity), true
case "ProfileWebhookSubscription.query":
if e.complexity.ProfileWebhookSubscription.Query == nil {
break
}
return e.complexity.ProfileWebhookSubscription.Query(childComplexity), true
case "ProfileWebhookSubscription.sample":
if e.complexity.ProfileWebhookSubscription.Sample == nil {
break
}
args, err := ec.field_ProfileWebhookSubscription_sample_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.ProfileWebhookSubscription.Sample(childComplexity, args["event"].(*model.WebhookEvent)), true
case "ProfileWebhookSubscription.url":
if e.complexity.ProfileWebhookSubscription.URL == nil {
break
}
return e.complexity.ProfileWebhookSubscription.URL(childComplexity), true
case "Query.auditLog":
if e.complexity.Query.AuditLog == nil {
break
}
args, err := ec.field_Query_auditLog_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.AuditLog(childComplexity, args["cursor"].(*model1.Cursor)), true
case "Query.invoices":
if e.complexity.Query.Invoices == nil {
break
}
args, err := ec.field_Query_invoices_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.Invoices(childComplexity, args["cursor"].(*model1.Cursor)), true
case "Query.me":
if e.complexity.Query.Me == nil {
break
}
return e.complexity.Query.Me(childComplexity), true
case "Query.oauthClientByID":
if e.complexity.Query.OauthClientByID == nil {
break
}
args, err := ec.field_Query_oauthClientByID_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.OauthClientByID(childComplexity, args["id"].(int)), true
case "Query.oauthClientByUUID":
if e.complexity.Query.OauthClientByUUID == nil {
break
}
args, err := ec.field_Query_oauthClientByUUID_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.OauthClientByUUID(childComplexity, args["uuid"].(string)), true
case "Query.oauthClients":
if e.complexity.Query.OauthClients == nil {
break
}
return e.complexity.Query.OauthClients(childComplexity), true
case "Query.oauthGrants":
if e.complexity.Query.OauthGrants == nil {
break
}
return e.complexity.Query.OauthGrants(childComplexity), true
case "Query.pgpKeyByFingerprint":
if e.complexity.Query.PGPKeyByFingerprint == nil {
break
}
args, err := ec.field_Query_pgpKeyByFingerprint_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.PGPKeyByFingerprint(childComplexity, args["fingerprint"].(string)), true
case "Query.personalAccessTokens":
if e.complexity.Query.PersonalAccessTokens == nil {
break
}
return e.complexity.Query.PersonalAccessTokens(childComplexity), true
case "Query.profileWebhook":
if e.complexity.Query.ProfileWebhook == nil {
break
}
args, err := ec.field_Query_profileWebhook_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.ProfileWebhook(childComplexity, args["id"].(int)), true
case "Query.profileWebhooks":
if e.complexity.Query.ProfileWebhooks == nil {
break
}
args, err := ec.field_Query_profileWebhooks_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.ProfileWebhooks(childComplexity, args["cursor"].(*model1.Cursor)), true
case "Query.sshKeyByFingerprint":
if e.complexity.Query.SSHKeyByFingerprint == nil {
break
}
args, err := ec.field_Query_sshKeyByFingerprint_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.SSHKeyByFingerprint(childComplexity, args["fingerprint"].(string)), true
case "Query.tokenRevocationStatus":
if e.complexity.Query.TokenRevocationStatus == nil {
break
}
args, err := ec.field_Query_tokenRevocationStatus_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.TokenRevocationStatus(childComplexity, args["hash"].(string), args["clientId"].(*string)), true
case "Query.userByEmail":
if e.complexity.Query.UserByEmail == nil {
break
}
args, err := ec.field_Query_userByEmail_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.UserByEmail(childComplexity, args["email"].(string)), true
case "Query.userByID":
if e.complexity.Query.UserByID == nil {
break
}
args, err := ec.field_Query_userByID_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.UserByID(childComplexity, args["id"].(int)), true
case "Query.userByName":
if e.complexity.Query.UserByName == nil {
break
}
args, err := ec.field_Query_userByName_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.UserByName(childComplexity, args["username"].(string)), true
case "Query.version":
if e.complexity.Query.Version == nil {
break
}
return e.complexity.Query.Version(childComplexity), true
case "Query.webhook":
if e.complexity.Query.Webhook == nil {
break
}
return e.complexity.Query.Webhook(childComplexity), true
case "SSHKey.comment":
if e.complexity.SSHKey.Comment == nil {
break
}
return e.complexity.SSHKey.Comment(childComplexity), true
case "SSHKey.created":
if e.complexity.SSHKey.Created == nil {
break
}
return e.complexity.SSHKey.Created(childComplexity), true
case "SSHKey.fingerprint":
if e.complexity.SSHKey.Fingerprint == nil {
break
}
return e.complexity.SSHKey.Fingerprint(childComplexity), true
case "SSHKey.id":
if e.complexity.SSHKey.ID == nil {
break
}
return e.complexity.SSHKey.ID(childComplexity), true
case "SSHKey.key":
if e.complexity.SSHKey.Key == nil {
break
}
return e.complexity.SSHKey.Key(childComplexity), true
case "SSHKey.lastUsed":
if e.complexity.SSHKey.LastUsed == nil {
break
}
return e.complexity.SSHKey.LastUsed(childComplexity), true
case "SSHKey.user":
if e.complexity.SSHKey.User == nil {
break
}
return e.complexity.SSHKey.User(childComplexity), true
case "SSHKeyCursor.cursor":
if e.complexity.SSHKeyCursor.Cursor == nil {
break
}
return e.complexity.SSHKeyCursor.Cursor(childComplexity), true
case "SSHKeyCursor.results":
if e.complexity.SSHKeyCursor.Results == nil {
break
}
return e.complexity.SSHKeyCursor.Results(childComplexity), true
case "SSHKeyEvent.date":
if e.complexity.SSHKeyEvent.Date == nil {
break
}
return e.complexity.SSHKeyEvent.Date(childComplexity), true
case "SSHKeyEvent.event":
if e.complexity.SSHKeyEvent.Event == nil {
break
}
return e.complexity.SSHKeyEvent.Event(childComplexity), true
case "SSHKeyEvent.key":
if e.complexity.SSHKeyEvent.Key == nil {
break
}
return e.complexity.SSHKeyEvent.Key(childComplexity), true
case "SSHKeyEvent.uuid":
if e.complexity.SSHKeyEvent.UUID == nil {
break
}
return e.complexity.SSHKeyEvent.UUID(childComplexity), true
case "User.bio":
if e.complexity.User.Bio == nil {
break
}
return e.complexity.User.Bio(childComplexity), true
case "User.canonicalName":
if e.complexity.User.CanonicalName == nil {
break
}
return e.complexity.User.CanonicalName(childComplexity), true
case "User.created":
if e.complexity.User.Created == nil {
break
}
return e.complexity.User.Created(childComplexity), true
case "User.email":
if e.complexity.User.Email == nil {
break
}
return e.complexity.User.Email(childComplexity), true
case "User.id":
if e.complexity.User.ID == nil {
break
}
return e.complexity.User.ID(childComplexity), true
case "User.location":
if e.complexity.User.Location == nil {
break
}
return e.complexity.User.Location(childComplexity), true
case "User.pgpKeys":
if e.complexity.User.PGPKeys == nil {
break
}
args, err := ec.field_User_pgpKeys_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.User.PGPKeys(childComplexity, args["cursor"].(*model1.Cursor)), true
case "User.sshKeys":
if e.complexity.User.SSHKeys == nil {
break
}
args, err := ec.field_User_sshKeys_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.User.SSHKeys(childComplexity, args["cursor"].(*model1.Cursor)), true
case "User.suspensionNotice":
if e.complexity.User.SuspensionNotice == nil {
break
}
return e.complexity.User.SuspensionNotice(childComplexity), true
case "User.url":
if e.complexity.User.URL == nil {
break
}
return e.complexity.User.URL(childComplexity), true
case "User.updated":
if e.complexity.User.Updated == nil {
break
}
return e.complexity.User.Updated(childComplexity), true
case "User.userType":
if e.complexity.User.UserType == nil {
break
}
return e.complexity.User.UserType(childComplexity), true
case "User.username":
if e.complexity.User.Username == nil {
break
}
return e.complexity.User.Username(childComplexity), true
case "Version.deprecationDate":
if e.complexity.Version.DeprecationDate == nil {
break
}
return e.complexity.Version.DeprecationDate(childComplexity), true
case "Version.major":
if e.complexity.Version.Major == nil {
break
}
return e.complexity.Version.Major(childComplexity), true
case "Version.minor":
if e.complexity.Version.Minor == nil {
break
}
return e.complexity.Version.Minor(childComplexity), true
case "Version.patch":
if e.complexity.Version.Patch == nil {
break
}
return e.complexity.Version.Patch(childComplexity), true
case "WebhookDelivery.date":
if e.complexity.WebhookDelivery.Date == nil {
break
}
return e.complexity.WebhookDelivery.Date(childComplexity), true
case "WebhookDelivery.event":
if e.complexity.WebhookDelivery.Event == nil {
break
}
return e.complexity.WebhookDelivery.Event(childComplexity), true
case "WebhookDelivery.requestBody":
if e.complexity.WebhookDelivery.RequestBody == nil {
break
}
return e.complexity.WebhookDelivery.RequestBody(childComplexity), true
case "WebhookDelivery.responseBody":
if e.complexity.WebhookDelivery.ResponseBody == nil {
break
}
return e.complexity.WebhookDelivery.ResponseBody(childComplexity), true
case "WebhookDelivery.responseHeaders":
if e.complexity.WebhookDelivery.ResponseHeaders == nil {
break
}
return e.complexity.WebhookDelivery.ResponseHeaders(childComplexity), true
case "WebhookDelivery.responseStatus":
if e.complexity.WebhookDelivery.ResponseStatus == nil {
break
}
return e.complexity.WebhookDelivery.ResponseStatus(childComplexity), true
case "WebhookDelivery.subscription":
if e.complexity.WebhookDelivery.Subscription == nil {
break
}
return e.complexity.WebhookDelivery.Subscription(childComplexity), true
case "WebhookDelivery.uuid":
if e.complexity.WebhookDelivery.UUID == nil {
break
}
return e.complexity.WebhookDelivery.UUID(childComplexity), true
case "WebhookDeliveryCursor.cursor":
if e.complexity.WebhookDeliveryCursor.Cursor == nil {
break
}
return e.complexity.WebhookDeliveryCursor.Cursor(childComplexity), true
case "WebhookDeliveryCursor.results":
if e.complexity.WebhookDeliveryCursor.Results == nil {
break
}
return e.complexity.WebhookDeliveryCursor.Results(childComplexity), true
case "WebhookSubscriptionCursor.cursor":
if e.complexity.WebhookSubscriptionCursor.Cursor == nil {
break
}
return e.complexity.WebhookSubscriptionCursor.Cursor(childComplexity), true
case "WebhookSubscriptionCursor.results":
if e.complexity.WebhookSubscriptionCursor.Results == nil {
break
}
return e.complexity.WebhookSubscriptionCursor.Results(childComplexity), true
}
return 0, false
}
func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler {
rc := graphql.GetOperationContext(ctx)
ec := executionContext{rc, e}
first := true
switch rc.Operation.Operation {
case ast.Query:
return func(ctx context.Context) *graphql.Response {
if !first {
return nil
}
first = false
data := ec._Query(ctx, rc.Operation.SelectionSet)
var buf bytes.Buffer
data.MarshalGQL(&buf)
return &graphql.Response{
Data: buf.Bytes(),
}
}
case ast.Mutation:
return func(ctx context.Context) *graphql.Response {
if !first {
return nil
}
first = false
data := ec._Mutation(ctx, rc.Operation.SelectionSet)
var buf bytes.Buffer
data.MarshalGQL(&buf)
return &graphql.Response{
Data: buf.Bytes(),
}
}
default:
return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation"))
}
}
type executionContext struct {
*graphql.OperationContext
*executableSchema
}
func (ec *executionContext) introspectSchema() (*introspection.Schema, error) {
if ec.DisableIntrospection {
return nil, errors.New("introspection disabled")
}
return introspection.WrapSchema(parsedSchema), nil
}
func (ec *executionContext) introspectType(name string) (*introspection.Type, error) {
if ec.DisableIntrospection {
return nil, errors.New("introspection disabled")
}
return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil
}
var sources = []*ast.Source{
{Name: "graph/schema.graphqls", Input: `# This schema definition is available in the public domain, or under the terms
# of CC-0, at your choice.
scalar Cursor
scalar Time
# This is used to decorate fields which are only accessible with a personal
# access token, and are not available to clients using OAuth 2.0 access tokens.
directive @private on FIELD_DEFINITION
# This used to decorate fields which are for internal use, and are not
# available to normal API users.
directive @internal on FIELD_DEFINITION
directive @anoninternal on FIELD_DEFINITION
# Used to provide a human-friendly description of an access scope.
directive @scopehelp(details: String!) on ENUM_VALUE
enum AccessScope {
AUDIT_LOG @scopehelp(details: "audit log")
BILLING @scopehelp(details: "billing history")
PGP_KEYS @scopehelp(details: "PGP keys")
SSH_KEYS @scopehelp(details: "SSH keys")
PROFILE @scopehelp(details: "profile information")
}
enum AccessKind {
RO @scopehelp(details: "read")
RW @scopehelp(details: "read and write")
}
# Decorates fields for which access requires a particular OAuth 2.0 scope with
# read or write access. For the meta.sr.ht API, you have access to all public
# information without any special permissions - user profile information,
# public keys, and so on.
directive @access(scope: AccessScope!, kind: AccessKind!) on FIELD_DEFINITION | ENUM_VALUE
# https://semver.org
type Version {
major: Int!
minor: Int!
patch: Int!
# If this API version is scheduled for deprecation, this is the date on which
# it will stop working; or null if this API version is not scheduled for
# deprecation.
deprecationDate: Time
}
interface Entity {
id: Int!
created: Time!
updated: Time!
# The canonical name of this entity. For users, this is their username
# prefixed with '~'. Additional entity types will be supported in the future.
canonicalName: String!
}
enum UserType {
UNCONFIRMED
ACTIVE_NON_PAYING
ACTIVE_FREE
ACTIVE_PAYING
ACTIVE_DELINQUENT
ADMIN
SUSPENDED
}
type User implements Entity {
id: Int!
created: Time!
updated: Time!
canonicalName: String!
username: String!
email: String!
url: String
location: String
bio: String
userType: UserType! @internal
suspensionNotice: String! @internal
sshKeys(cursor: Cursor): SSHKeyCursor! @access(scope: SSH_KEYS, kind: RO)
pgpKeys(cursor: Cursor): PGPKeyCursor! @access(scope: PGP_KEYS, kind: RO)
}
type AuditLogEntry {
id: Int!
created: Time!
ipAddress: String!
eventType: String!
details: String
}
type SSHKey {
id: Int!
created: Time!
lastUsed: Time
user: User! @access(scope: PROFILE, kind: RO)
key: String!
fingerprint: String!
comment: String
}
type PGPKey {
id: Int!
created: Time!
user: User! @access(scope: PROFILE, kind: RO)
key: String!
fingerprint: String!
}
type Invoice {
id: Int!
created: Time!
cents: Int!
validThru: Time!
source: String
}
type OAuthGrant {
id: Int!
client: OAuthClient!
issued: Time!
expires: Time!
tokenHash: String! @internal
}
type OAuthGrantRegistration {
grant: OAuthGrant!
grants: String!
secret: String!
}
type OAuthClient {
id: Int!
uuid: String!
redirectUrl: String!
name: String!
description: String
url: String
owner: Entity! @access(scope: PROFILE, kind: RO)
}
type OAuthClientRegistration {
client: OAuthClient!
secret: String!
}
type OAuthPersonalToken {
id: Int!
issued: Time!
expires: Time!
comment: String
}
type OAuthPersonalTokenRegistration {
token: OAuthPersonalToken!
secret: String!
}
enum WebhookEvent {
# Used for user profile webhooks
PROFILE_UPDATE @access(scope: PROFILE, kind: RO)
PGP_KEY_ADDED @access(scope: PGP_KEYS, kind: RO)
PGP_KEY_REMOVED @access(scope: PGP_KEYS, kind: RO)
SSH_KEY_ADDED @access(scope: SSH_KEYS, kind: RO)
SSH_KEY_REMOVED @access(scope: SSH_KEYS, kind: RO)
}
interface WebhookSubscription {
id: Int!
events: [WebhookEvent!]!
query: String!
url: String!
# If this webhook was registered by an authorized OAuth 2.0 client, this
# field is non-null.
client: OAuthClient @private
# All deliveries which have been sent to this webhook.
deliveries(cursor: Cursor): WebhookDeliveryCursor!
# Returns a sample payload for this subscription, for testing purposes
sample(event: WebhookEvent!): String!
}
type ProfileWebhookSubscription implements WebhookSubscription {
id: Int!
events: [WebhookEvent!]!
query: String!
url: String!
client: OAuthClient @private
deliveries(cursor: Cursor): WebhookDeliveryCursor!
sample(event: WebhookEvent): String!
}
type WebhookDelivery {
uuid: String!
date: Time!
event: WebhookEvent!
subscription: WebhookSubscription!
requestBody: String!
# These details are provided only after a response is received from the
# remote server. If a response is sent whose Content-Type is not text/*, or
# cannot be decoded as UTF-8, the response body will be null. It will be
# truncated after 64 KiB.
responseBody: String
responseHeaders: String
responseStatus: Int
}
interface WebhookPayload {
uuid: String!
event: WebhookEvent!
date: Time!
}
type ProfileUpdateEvent implements WebhookPayload {
uuid: String!
event: WebhookEvent!
date: Time!
profile: User!
}
type PGPKeyEvent implements WebhookPayload {
uuid: String!
event: WebhookEvent!
date: Time!
key: PGPKey!
}
type SSHKeyEvent implements WebhookPayload {
uuid: String!
event: WebhookEvent!
date: Time!
key: SSHKey!
}
# A cursor for enumerating a list of audit log entries
#
# If there are additional results available, the cursor object may be passed
# back into the same endpoint to retrieve another page. If the cursor is null,
# there are no remaining results to return.
type AuditLogCursor {
results: [AuditLogEntry!]!
cursor: Cursor
}
# A cursor for enumerating a list of invoices
#
# If there are additional results available, the cursor object may be passed
# back into the same endpoint to retrieve another page. If the cursor is null,
# there are no remaining results to return.
type InvoiceCursor {
results: [Invoice!]!
cursor: Cursor
}
# A cursor for enumerating a list of SSH keys
#
# If there are additional results available, the cursor object may be passed
# back into the same endpoint to retrieve another page. If the cursor is null,
# there are no remaining results to return.
type SSHKeyCursor {
results: [SSHKey!]!
cursor: Cursor
}
# A cursor for enumerating a list of PGP keys
#
# If there are additional results available, the cursor object may be passed
# back into the same endpoint to retrieve another page. If the cursor is null,
# there are no remaining results to return.
type PGPKeyCursor {
results: [PGPKey!]!
cursor: Cursor
}
# A cursor for enumerating a list of webhook deliveries
#
# If there are additional results available, the cursor object may be passed
# back into the same endpoint to retrieve another page. If the cursor is null,
# there are no remaining results to return.
type WebhookDeliveryCursor {
results: [WebhookDelivery!]!
cursor: Cursor
}
# A cursor for enumerating a list of webhook subscriptions
#
# If there are additional results available, the cursor object may be passed
# back into the same endpoint to retrieve another page. If the cursor is null,
# there are no remaining results to return.
type WebhookSubscriptionCursor {
results: [WebhookSubscription!]!
cursor: Cursor
}
type Query {
# Returns API version information.
version: Version!
# Returns the authenticated user.
me: User! @access(scope: PROFILE, kind: RO)
# Returns a specific user
userByID(id: Int!): User @access(scope: PROFILE, kind: RO)
userByName(username: String!): User @access(scope: PROFILE, kind: RO)
userByEmail(email: String!): User @access(scope: PROFILE, kind: RO)
# Returns a specific SSH key by its fingerprint, in hexadecimal
sshKeyByFingerprint(fingerprint: String!): SSHKey @access(scope: SSH_KEYS, kind: RO)
# Returns a specific PGP key by its fingerprint, in hexadecimal.
pgpKeyByFingerprint(fingerprint: String!): PGPKey @access(scope: PGP_KEYS, kind: RO)
# Returns invoices for the authenticated user.
invoices(cursor: Cursor): InvoiceCursor! @access(scope: BILLING, kind: RO)
# Returns the audit log for the authenticated user.
auditLog(cursor: Cursor): AuditLogCursor! @access(scope: AUDIT_LOG, kind: RO)
# Returns a list of user profile webhook subscriptions. For clients
# authenticated with a personal access token, this returns all webhooks
# configured by all GraphQL clients for your account. For clients
# authenticated with an OAuth 2.0 access token, this returns only webhooks
# registered for your client.
profileWebhooks(cursor: Cursor): WebhookSubscriptionCursor!
# Returns details of a user profile webhook subscription by its ID.
profileWebhook(id: Int!): WebhookSubscription
# Returns information about the webhook currently being processed. This is
# not valid during normal queries over HTTP, and will return an error if used
# outside of a webhook context.
webhook: WebhookPayload!
# Returns OAuth grants issued for the authenticated user
oauthGrants: [OAuthGrant]! @private
# List of OAuth clients this user administrates
oauthClients: [OAuthClient]! @private
# Returns a list of personal OAuth tokens issued
personalAccessTokens: [OAuthPersonalToken]! @private
### ###
### The following resolvers are for internal use. ###
### ###
# Returns a specific OAuth client (by database ID)
oauthClientByID(id: Int!): OAuthClient @internal
# Returns a specific OAuth client (by UUID)
oauthClientByUUID(uuid: String!): OAuthClient @internal
# Returns the revocation status of a given OAuth 2.0 token hash (SHA-512). If
# the token or client ID has been revoked, this returns true, and the key
# should not be trusted. Client ID is optional for personal access tokens.
tokenRevocationStatus(hash: String!, clientId: String): Boolean! @internal
}
input UserInput {
# Omit these fields to leave them unchanged, or set them to null to clear
# their value.
url: String
location: String
bio: String
# Note: changing the user's email address will not take effect immediately;
# the user is sent an email to confirm the change first.
email: String
}
input ProfileWebhookInput {
url: String!
events: [WebhookEvent!]!
query: String!
}
type Mutation {
updateUser(input: UserInput): User! @access(scope: PROFILE, kind: RW)
createPGPKey(key: String!): PGPKey! @access(scope: PGP_KEYS, kind: RW)
deletePGPKey(id: Int!): PGPKey @access(scope: PGP_KEYS, kind: RW)
createSSHKey(key: String!): SSHKey! @access(scope: SSH_KEYS, kind: RW)
deleteSSHKey(id: Int!): SSHKey @access(scope: SSH_KEYS, kind: RW)
# Causes the "last used" time of this SSH key to be updated.
updateSSHKey(id: Int!): SSHKey! @access(scope: SSH_KEYS, kind: RO)
# Creates a new user profile webhook subscription. When an event from the
# provided list of events occurs, the 'query' parameter (a GraphQL query)
# will be evaluated and the results will be sent to the provided URL as the
# body of an HTTP POST request. The list of events must include at least one
# event, and no duplicates.
#
# This query is evaluated in the webhook context, such that query { webhook }
# may be used to access details of the event which trigged the webhook. The
# query may not make any mutations.
createWebhook(config: ProfileWebhookInput!): WebhookSubscription!
# Deletes a user profile webhook. Any events already queued may still be
# delivered after this request completes. Clients authenticated with a
# personal access token may delete any webhook registered for their account,
# but authorized OAuth 2.0 clients may only delete their own webhooks.
# Manually deleting a webhook configured by a third-party client may cause
# unexpected behavior with the third-party integration.
deleteWebhook(id: Int!): WebhookSubscription
### ###
### The following resolvers are for internal use. ###
### ###
# Registers a new account.
registerAccount(email: String!,
username: String!,
password: String!,
pgpKey: String,
invite: String): User @anoninternal
# Registers an OAuth client. Only OAuth 2.0 confidental clients are
# supported.
registerOAuthClient(
redirectUri: String!,
clientName: String!,
clientDescription: String,
clientUrl: String): OAuthClientRegistration! @internal
# Revokes this OAuth client, revoking all tokens for it and preventing future
# use.
revokeOAuthClient(uuid: String!): OAuthClient @internal
# Revokes a specific OAuth grant.
revokeOAuthGrant(hash: String!): OAuthGrant @internal
# Issues an OAuth personal access token.
issuePersonalAccessToken(grants: String, comment: String):
OAuthPersonalTokenRegistration! @internal
# Revokes a personal access token.
revokePersonalAccessToken(id: Int!): OAuthPersonalToken @internal
# Issues an OAuth 2.0 authorization code. Used after the user has consented
# to the access grant request.
issueAuthorizationCode(clientUUID: String!, grants: String!): String! @internal
# Completes the OAuth 2.0 grant process and issues an OAuth token for a
# specific OAuth client.
issueOAuthGrant(authorization: String!,
clientSecret: String!): OAuthGrantRegistration @internal
}
`, BuiltIn: false},
}
var parsedSchema = gqlparser.MustLoadSchema(sources...)
// endregion ************************** generated!.gotpl **************************
// region ***************************** args.gotpl *****************************
func (ec *executionContext) dir_access_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 model.AccessScope
if tmp, ok := rawArgs["scope"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scope"))
arg0, err = ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋmetaᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, tmp)
if err != nil {
return nil, err
}
}
args["scope"] = arg0
var arg1 model.AccessKind
if tmp, ok := rawArgs["kind"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind"))
arg1, err = ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋmetaᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, tmp)
if err != nil {
return nil, err
}
}
args["kind"] = arg1
return args, nil
}
func (ec *executionContext) dir_scopehelp_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["details"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("details"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["details"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_createPGPKey_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["key"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["key"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_createSSHKey_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["key"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["key"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_createWebhook_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 model.ProfileWebhookInput
if tmp, ok := rawArgs["config"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config"))
arg0, err = ec.unmarshalNProfileWebhookInput2gitᚗsrᚗhtᚋאsircmpwnᚋmetaᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐProfileWebhookInput(ctx, tmp)
if err != nil {
return nil, err
}
}
args["config"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_deletePGPKey_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 int
if tmp, ok := rawArgs["id"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
arg0, err = ec.unmarshalNInt2int(ctx, tmp)
if err != nil {
return nil, err
}
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_deleteSSHKey_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 int
if tmp, ok := rawArgs["id"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
arg0, err = ec.unmarshalNInt2int(ctx, tmp)
if err != nil {
return nil, err
}
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_deleteWebhook_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 int
if tmp, ok := rawArgs["id"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
arg0, err = ec.unmarshalNInt2int(ctx, tmp)
if err != nil {
return nil, err
}
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_issueAuthorizationCode_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["clientUUID"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientUUID"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["clientUUID"] = arg0
var arg1 string
if tmp, ok := rawArgs["grants"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("grants"))
arg1, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["grants"] = arg1
return args, nil
}
func (ec *executionContext) field_Mutation_issueOAuthGrant_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["authorization"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorization"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["authorization"] = arg0
var arg1 string
if tmp, ok := rawArgs["clientSecret"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecret"))
arg1, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["clientSecret"] = arg1
return args, nil
}
func (ec *executionContext) field_Mutation_issuePersonalAccessToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *string
if tmp, ok := rawArgs["grants"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("grants"))
arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp)
if err != nil {
return nil, err
}
}
args["grants"] = arg0
var arg1 *string
if tmp, ok := rawArgs["comment"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("comment"))
arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp)
if err != nil {
return nil, err
}
}
args["comment"] = arg1
return args, nil
}
func (ec *executionContext) field_Mutation_registerAccount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["email"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["email"] = arg0
var arg1 string
if tmp, ok := rawArgs["username"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username"))
arg1, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["username"] = arg1
var arg2 string
if tmp, ok := rawArgs["password"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password"))
arg2, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["password"] = arg2
var arg3 *string
if tmp, ok := rawArgs["pgpKey"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pgpKey"))
arg3, err = ec.unmarshalOString2ᚖstring(ctx, tmp)
if err != nil {
return nil, err
}
}
args["pgpKey"] = arg3
var arg4 *string
if tmp, ok := rawArgs["invite"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("invite"))
arg4, err = ec.unmarshalOString2ᚖstring(ctx, tmp)
if err != nil {
return nil, err
}
}
args["invite"] = arg4
return args, nil
}
func (ec *executionContext) field_Mutation_registerOAuthClient_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["redirectUri"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectUri"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["redirectUri"] = arg0
var arg1 string
if tmp, ok := rawArgs["clientName"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientName"))
arg1, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["clientName"] = arg1
var arg2 *string
if tmp, ok := rawArgs["clientDescription"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientDescription"))
arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp)
if err != nil {
return nil, err
}
}
args["clientDescription"] = arg2
var arg3 *string
if tmp, ok := rawArgs["clientUrl"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientUrl"))
arg3, err = ec.unmarshalOString2ᚖstring(ctx, tmp)
if err != nil {
return nil, err
}
}
args["clientUrl"] = arg3
return args, nil
}
func (ec *executionContext) field_Mutation_revokeOAuthClient_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["uuid"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uuid"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["uuid"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_revokeOAuthGrant_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["hash"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hash"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["hash"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_revokePersonalAccessToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 int
if tmp, ok := rawArgs["id"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
arg0, err = ec.unmarshalNInt2int(ctx, tmp)
if err != nil {
return nil, err
}
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_updateSSHKey_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 int
if tmp, ok := rawArgs["id"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
arg0, err = ec.unmarshalNInt2int(ctx, tmp)
if err != nil {
return nil, err
}
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_updateUser_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 map[string]interface{}
if tmp, ok := rawArgs["input"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
arg0, err = ec.unmarshalOUserInput2map(ctx, tmp)
if err != nil {
return nil, err
}
}
args["input"] = arg0
return args, nil
}
func (ec *executionContext) field_ProfileWebhookSubscription_deliveries_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *model1.Cursor
if tmp, ok := rawArgs["cursor"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cursor"))
arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, tmp)
if err != nil {
return nil, err
}
}
args["cursor"] = arg0
return args, nil
}
func (ec *executionContext) field_ProfileWebhookSubscription_sample_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *model.WebhookEvent
if tmp, ok := rawArgs["event"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("event"))
arg0, err = ec.unmarshalOWebhookEvent2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋmetaᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐWebhookEvent(ctx, tmp)
if err != nil {
return nil, err
}
}
args["event"] = arg0
return args, nil
}
func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["name"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["name"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_auditLog_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *model1.Cursor
if tmp, ok := rawArgs["cursor"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cursor"))
arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, tmp)
if err != nil {
return nil, err
}
}
args["cursor"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_invoices_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *model1.Cursor
if tmp, ok := rawArgs["cursor"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cursor"))
arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, tmp)
if err != nil {
return nil, err
}
}
args["cursor"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_oauthClientByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 int
if tmp, ok := rawArgs["id"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
arg0, err = ec.unmarshalNInt2int(ctx, tmp)
if err != nil {
return nil, err
}
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_oauthClientByUUID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["uuid"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uuid"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["uuid"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_pgpKeyByFingerprint_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["fingerprint"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fingerprint"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["fingerprint"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_profileWebhook_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 int
if tmp, ok := rawArgs["id"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
arg0, err = ec.unmarshalNInt2int(ctx, tmp)
if err != nil {
return nil, err
}
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_profileWebhooks_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *model1.Cursor
if tmp, ok := rawArgs["cursor"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cursor"))
arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, tmp)
if err != nil {
return nil, err
}
}
args["cursor"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_sshKeyByFingerprint_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["fingerprint"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fingerprint"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["fingerprint"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_tokenRevocationStatus_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["hash"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hash"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["hash"] = arg0
var arg1 *string
if tmp, ok := rawArgs["clientId"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientId"))
arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp)
if err != nil {
return nil, err
}
}
args["clientId"] = arg1
return args, nil
}
func (ec *executionContext) field_Query_userByEmail_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["email"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["email"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_userByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 int
if tmp, ok := rawArgs["id"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
arg0, err = ec.unmarshalNInt2int(ctx, tmp)
if err != nil {
return nil, err
}
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_userByName_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["username"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["username"] = arg0
return args, nil
}
func (ec *executionContext) field_User_pgpKeys_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *model1.Cursor
if tmp, ok := rawArgs["cursor"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cursor"))
arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, tmp)
if err != nil {
return nil, err
}
}
args["cursor"] = arg0
return args, nil
}
func (ec *executionContext) field_User_sshKeys_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *model1.Cursor
if tmp, ok := rawArgs["cursor"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cursor"))
arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, tmp)
if err != nil {
return nil, err
}
}
args["cursor"] = arg0
return args, nil
}
func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 bool
if tmp, ok := rawArgs["includeDeprecated"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated"))
arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp)
if err != nil {
return nil, err
}
}
args["includeDeprecated"] = arg0
return args, nil
}
func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 bool
if tmp, ok := rawArgs["includeDeprecated"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated"))
arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp)
if err != nil {
return nil, err
}
}
args["includeDeprecated"] = arg0
return args, nil
}
// endregion ***************************** args.gotpl *****************************
// region ************************** directives.gotpl **************************
// endregion ************************** directives.gotpl **************************
// region **************************** field.gotpl *****************************
func (ec *executionContext) _AuditLogCursor_results(ctx context.Context, field graphql.CollectedField, obj *model.AuditLogCursor) (ret graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = graphql.Null
}
}()
fc := &graphql.FieldContext{
Object: "AuditLogCursor",
Field: field,
Args: nil,
IsMethod: false,
IsResolver: false,
}
ctx = graphql.WithFieldContext(ctx, fc)
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
ctx = rctx // use context from middleware stack in children
return obj.Results, nil
})
if err != nil {
ec.Error(ctx, err)
return graphql.Null
}
if resTmp == nil {
if !graphql.HasFieldError(ctx, fc) {
ec.Errorf(ctx, "must not be null")
}
return graphql.Null
}
res := resTmp.([]*model.AuditLogEntry)
fc.Result = res
return ec.marshalNAuditLogEntry2ᚕᚖgitᚗsrᚗhtᚋאsircmpwnᚋmetaᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAuditLogEntryᚄ(ctx, field.Selections, res)
}
func (ec *executionContext) _AuditLogCursor_cursor(ctx context.Context, field graphql.CollectedField, obj *model.AuditLogCursor) (ret graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = graphql.Null
}
}()
fc := &graphql.FieldContext{
Object: "AuditLogCursor",
Field: field,
Args: nil,
IsMethod: false,
IsResolver: false,
}
ctx = graphql.WithFieldContext(ctx, fc)
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
ctx = rctx // use context from middleware stack in children
return obj.Cursor, nil
})
if err != nil {
ec.Error(ctx, err)
return graphql.Null
}
if resTmp == nil {
return graphql.Null
}
res := resTmp.(*model1.Cursor)
fc.Result = res
return ec.marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, field.Selections, res)
}
func (ec *executionContext) _AuditLogEntry_id(ctx context.Context, field graphql.CollectedField, obj *model.AuditLogEntry) (ret graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = graphql.Null
}
}()
fc := &graphql.FieldContext{
Object: "AuditLogEntry",
Field: field,
Args: nil,
IsMethod: false,
IsResolver: false,
}
ctx = graphql.WithFieldContext(ctx, fc)
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
ctx = rctx // use context from middleware stack in children
return obj.ID, nil
})
if err != nil {
ec.Error(ctx, err)
return graphql.Null
}
if resTmp == nil {
if !graphql.HasFieldError(ctx, fc) {
ec.Errorf(ctx, "must not be n