b8c0bb4125
all mutations that require more than 1 input now has an input type 🌟 fixes #10
39 lines
792 B
GraphQL
39 lines
792 B
GraphQL
extend type User{
|
|
"""
|
|
Returns a list of your personal api tokens.
|
|
"""
|
|
apiTokens: [ApiToken]
|
|
@hasRole(role: "server:user")
|
|
@hasScope(scope: "tokens:read")
|
|
}
|
|
|
|
type ApiToken {
|
|
id: String!
|
|
name: String!
|
|
lastChars: String!
|
|
scopes: [String]!
|
|
createdAt: String! #date
|
|
lifespan: BigInt!
|
|
lastUsed: String! #date
|
|
}
|
|
|
|
input ApiTokenCreateInput {
|
|
scopes: [String!]!,
|
|
name: String!,
|
|
lifespan: BigInt
|
|
}
|
|
|
|
extend type Mutation {
|
|
"""
|
|
Creates an personal api token.
|
|
"""
|
|
apiTokenCreate(token: ApiTokenCreateInput!):String!
|
|
@hasRole(role: "server:user")
|
|
@hasScope(scope: "tokens:write")
|
|
"""
|
|
Revokes (deletes) an personal api token.
|
|
"""
|
|
apiTokenRevoke(token: String!):Boolean!
|
|
@hasRole(role: "server:user")
|
|
@hasScope(scope: "tokens:write")
|
|
} |