Files
probo/pkg/server/api/connect/v1/graphql/personal_api_key.graphql
Bryan Frimin 383ea5a2d4 Retrict some query and mutation to only session
Signed-off-by: Bryan Frimin <bryan@probo.com>
2026-06-02 17:43:21 -07:00

63 lines
1.3 KiB
GraphQL

type PersonalAPIKey implements Node {
id: ID!
name: String!
expiresAt: Datetime!
lastUsedAt: Datetime
createdAt: Datetime!
token: String
@goField(forceResolver: true)
@authentication(required: PRESENT)
@sessionOnly
permission(action: String!): Boolean!
@goField(forceResolver: true)
@authentication(required: PRESENT)
@sessionOnly
}
type PersonalAPIKeyConnection
@goModel(
model: "go.probo.inc/probo/pkg/server/api/connect/v1/types.PersonalAPIKeyConnection"
) {
edges: [PersonalAPIKeyEdge!]!
pageInfo: PageInfo!
totalCount: Int @goField(forceResolver: true)
}
type PersonalAPIKeyEdge {
node: PersonalAPIKey!
cursor: CursorKey!
}
extend type Mutation {
createPersonalAPIKey(
input: CreatePersonalAPIKeyInput!
): CreatePersonalAPIKeyPayload
@authentication(required: PRESENT)
@sessionOnly
revokePersonalAPIKey(
input: RevokePersonalAPIKeyInput!
): RevokePersonalAPIKeyPayload
@authentication(required: PRESENT)
@sessionOnly
}
input CreatePersonalAPIKeyInput {
name: String!
expiresAt: Datetime!
}
input RevokePersonalAPIKeyInput {
personalAPIKeyId: ID!
}
type CreatePersonalAPIKeyPayload {
personalAPIKeyEdge: PersonalAPIKeyEdge!
token: String!
}
type RevokePersonalAPIKeyPayload {
personalAPIKeyId: ID!
}