stacker.news/fragments/vault.js

45 lines
761 B
JavaScript
Raw Normal View History

import { gql } from '@apollo/client'
2024-10-27 07:43:45 +00:00
export const VAULT_ENTRY_FIELDS = gql`
fragment VaultEntryFields on VaultEntry {
id
key
2024-10-27 07:43:45 +00:00
iv
value
createdAt
2024-10-23 00:53:56 +00:00
updatedAt
}
`
2024-10-23 00:53:56 +00:00
export const GET_VAULT_ENTRY = gql`
2024-10-27 07:43:45 +00:00
${VAULT_ENTRY_FIELDS}
query GetVaultEntry(
$key: String!
) {
2024-10-23 00:53:56 +00:00
getVaultEntry(key: $key) {
2024-10-27 07:43:45 +00:00
...VaultEntryFields
}
}
`
2024-10-23 00:53:56 +00:00
export const GET_VAULT_ENTRIES = gql`
2024-10-27 07:43:45 +00:00
${VAULT_ENTRY_FIELDS}
2024-10-23 00:53:56 +00:00
query GetVaultEntries {
getVaultEntries {
2024-10-27 07:43:45 +00:00
...VaultEntryFields
}
}
`
export const CLEAR_VAULT = gql`
mutation ClearVault {
clearVault
}
`
2024-10-23 00:53:56 +00:00
export const UPDATE_VAULT_KEY = gql`
mutation updateVaultKey($entries: [VaultEntryInput!]!, $hash: String!) {
updateVaultKey(entries: $entries, hash: $hash)
}
`