Ocelot-Social/webapp/graphql/InviteCode.js
Ulf Gebhardt 30560bff69
fix(webapp): fix user avatar & post image urls (#8921)
Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com>
2025-09-25 22:19:27 +02:00

148 lines
2.5 KiB
JavaScript

import gql from 'graphql-tag'
import { imageUrls } from './fragments/imageUrls'
export const validateInviteCode = () => gql`
${imageUrls}
query validateInviteCode($code: String!) {
validateInviteCode(code: $code) {
code
invitedTo {
slug
groupType
name
about
avatar {
...imageUrls
}
}
generatedBy {
name
avatar {
...imageUrls
}
}
isValid
}
}
`
export const generatePersonalInviteCode = () => gql`
${imageUrls}
mutation generatePersonalInviteCode($expiresAt: String, $comment: String) {
generatePersonalInviteCode(expiresAt: $expiresAt, comment: $comment) {
code
createdAt
generatedBy {
id
name
avatar {
...imageUrls
}
}
redeemedBy {
id
name
avatar {
...imageUrls
}
}
redeemedByCount
expiresAt
comment
invitedTo {
groupType
name
about
avatar {
...imageUrls
}
}
isValid
}
}
`
export const generateGroupInviteCode = () => gql`
${imageUrls}
mutation generateGroupInviteCode($groupId: ID!, $expiresAt: String, $comment: String) {
generateGroupInviteCode(groupId: $groupId, expiresAt: $expiresAt, comment: $comment) {
code
createdAt
generatedBy {
id
name
avatar {
...imageUrls
}
}
redeemedBy {
id
name
avatar {
...imageUrls
}
}
redeemedByCount
expiresAt
comment
invitedTo {
id
groupType
name
about
avatar {
...imageUrls
}
}
isValid
}
}
`
export const invalidateInviteCode = () => gql`
${imageUrls}
mutation invalidateInviteCode($code: String!) {
invalidateInviteCode(code: $code) {
code
createdAt
generatedBy {
id
name
avatar {
...imageUrls
}
}
redeemedBy {
id
name
avatar {
...imageUrls
}
}
redeemedByCount
expiresAt
comment
invitedTo {
id
groupType
name
about
avatar {
...imageUrls
}
}
isValid
}
}
`
export const redeemInviteCode = () => gql`
mutation redeemInviteCode($code: String!) {
redeemInviteCode(code: $code)
}
`