Skip to content

Commit 320d822

Browse files
committed
feat(postgraphile)!: upgrade to v5
1 parent 4408a86 commit 320d822

57 files changed

Lines changed: 11830 additions & 19492 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# check=skip=SecretsUsedInArgOrEnv
33

44
# <DEPENDENCIES>
5-
FROM ghcr.io/maevsi/sqitch:10.0
5+
FROM ghcr.io/maevsi/postgraphile:2.0.0-beta.1
66
# </DEPENDENCIES>
77

88
#############

src/app/components/account/AccountProfilePicture.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const TUSD_FILES_URL = useTusdFilesUrl()
3737
// api data
3838
const query = useQuery({
3939
query: graphql(`
40-
query AccountById($id: UUID!) {
41-
accountById(id: $id) {
40+
query AccountByRowId($id: UUID!) {
41+
accountByRowId(rowId: $id) {
4242
id
4343
profilePictureByAccountId {
4444
id
@@ -56,7 +56,7 @@ const query = useQuery({
5656
},
5757
})
5858
const api = await useApiData([query])
59-
const account = computed(() => api.value.data.accountById)
59+
const account = computed(() => api.value.data.accountByRowId)
6060
const upload = computed(
6161
() => account.value?.profilePictureByAccountId?.uploadByUploadId,
6262
)

src/app/components/app/attendance/guest/AppAttendanceGuestDynamic.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const { guestId } = defineProps<{
2020
const query = await useQuery({
2121
query: graphql(`
2222
query AttendanceGuest($id: UUID!) {
23-
guestById(id: $id) {
23+
guestByRowId(rowId: $id) {
2424
contactByContactId {
2525
accountByAccountId {
2626
id
@@ -47,7 +47,7 @@ const query = await useQuery({
4747
},
4848
})
4949
50-
const guest = computed(() => query.data.value?.guestById)
50+
const guest = computed(() => query.data.value?.guestByRowId)
5151
5252
const { t } = useI18n()
5353
</script>

src/app/components/contact/ContactList.vue

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
<LayoutTbody>
3232
<ContactListItem
3333
v-for="contact in contacts"
34-
:id="contact.nodeId"
35-
:key="contact.nodeId"
34+
:id="contact.rowId"
35+
:key="contact.rowId"
3636
:contact
37-
:is-deleting="pending.deletions.includes(contact.nodeId)"
38-
:is-editing="pending.edits.includes(contact.nodeId)"
39-
@delete="delete_(contact.nodeId, contact.id)"
37+
:is-deleting="pending.deletions.includes(contact.rowId)"
38+
:is-editing="pending.edits.includes(contact.rowId)"
39+
@delete="delete_(contact.rowId)"
4040
@edit="edit(contact)"
4141
/>
4242
</LayoutTbody>
@@ -64,7 +64,7 @@
6464
</template>
6565

6666
<script setup lang="ts">
67-
import { useDeleteContactByIdMutation } from '~~/gql/documents/mutations/contact/contactDeleteById'
67+
import { useDeleteContactByRowIdMutation } from '~~/gql/documents/mutations/contact/contactDeleteByRowId'
6868
import { useAllContactsQuery } from '~~/gql/documents/queries/contact/contactsAll'
6969
import type { ContactItemFragment } from '~~/gql/generated/graphql'
7070
import { getContactItem } from '~~/gql/documents/fragments/contactItem'
@@ -88,8 +88,8 @@ const selectedContact = ref<
8888
| 'firstName'
8989
| 'id'
9090
| 'lastName'
91-
| 'nodeId'
9291
| 'phoneNumber'
92+
| 'rowId'
9393
| 'url'
9494
>
9595
>()
@@ -102,8 +102,8 @@ const contactsQuery = useAllContactsQuery(
102102
first: ITEMS_PER_PAGE_LARGE,
103103
})),
104104
)
105-
const deleteContactByIdMutation = useDeleteContactByIdMutation()
106-
const api = await useApiData([contactsQuery, deleteContactByIdMutation])
105+
const deleteContactByRowIdMutation = useDeleteContactByRowIdMutation()
106+
const api = await useApiData([contactsQuery, deleteContactByRowIdMutation])
107107
const contacts = computed(
108108
() =>
109109
api.value.data.allContacts?.nodes
@@ -118,10 +118,10 @@ const add = () => {
118118
selectedContact.value = undefined
119119
store.modals.push({ id: 'ModalContact' })
120120
}
121-
const delete_ = async (nodeId: string, id: string) => {
122-
pending.deletions.push(nodeId)
123-
await deleteContactByIdMutation.executeMutation({ id })
124-
pending.deletions.splice(pending.deletions.indexOf(nodeId), 1)
121+
const delete_ = async (rowId: string) => {
122+
pending.deletions.push(rowId)
123+
await deleteContactByRowIdMutation.executeMutation({ id: rowId })
124+
pending.deletions.splice(pending.deletions.indexOf(rowId), 1)
125125
// TODO: update cache, especially pagination, or reset query (https://github.com/maevsi/vibetype/issues/720)
126126
}
127127
const edit = (
@@ -133,12 +133,12 @@ const edit = (
133133
| 'firstName'
134134
| 'id'
135135
| 'lastName'
136-
| 'nodeId'
137136
| 'phoneNumber'
137+
| 'rowId'
138138
| 'url'
139139
>,
140140
) => {
141-
pending.edits.push(contact.nodeId)
141+
pending.edits.push(contact.rowId)
142142
formContactHeading.value = t('contactEdit')
143143
selectedContact.value = contact
144144
store.modals.push({ id: 'ModalContact' })
@@ -151,7 +151,7 @@ const onContactSubmitSuccess = () => {
151151
const onModalContactClose = () => {
152152
if (!selectedContact.value) return
153153
154-
pending.edits.splice(pending.edits.indexOf(selectedContact.value.nodeId), 1)
154+
pending.edits.splice(pending.edits.indexOf(selectedContact.value.rowId), 1)
155155
}
156156
</script>
157157

src/app/components/contact/ContactListItem.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<tr
33
v-if="contact"
4-
:key="contact.nodeId"
4+
:key="contact.rowId"
55
:class="{
66
'animate-pulse': isDeleting,
77
}"
@@ -56,7 +56,6 @@ import type { ContactItemFragment } from '~~/gql/generated/graphql'
5656
const { contact, isDeleting, isEditing } = defineProps<{
5757
contact: Pick<
5858
ContactItemFragment,
59-
| 'nodeId'
6059
| 'accountId'
6160
| 'accountByAccountId'
6261
| 'accountByCreatedBy'
@@ -67,6 +66,7 @@ const { contact, isDeleting, isEditing } = defineProps<{
6766
| 'firstName'
6867
| 'lastName'
6968
| 'phoneNumber'
69+
| 'rowId'
7070
| 'url'
7171
>
7272
isDeleting?: boolean

src/app/components/event/card/EventCard.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,16 @@ const createEventFavoriteMutation = useMutation(
226226
createdBy
227227
eventId
228228
id
229-
nodeId
229+
rowId
230230
}
231231
}
232232
}
233233
`),
234234
)
235-
const deleteEventFavoriteByIdMutation = useMutation(
235+
const deleteEventFavoriteByRowIdMutation = useMutation(
236236
graphql(`
237-
mutation DeleteEventFavoriteById($input: DeleteEventFavoriteByIdInput!) {
238-
deleteEventFavoriteById(input: $input) {
237+
mutation DeleteEventFavoriteByRowId($input: DeleteEventFavoriteInput!) {
238+
deleteEventFavorite(input: $input) {
239239
clientMutationId
240240
}
241241
}
@@ -244,7 +244,7 @@ const deleteEventFavoriteByIdMutation = useMutation(
244244
// TODO: show loading state, error details
245245
// const api = await useApiData([
246246
// createEventFavoriteMutation,
247-
// deleteEventFavoriteByIdMutation,
247+
// deleteEventFavoriteByRowIdMutation,
248248
// ])
249249
const isFavorite = computed(
250250
() =>
@@ -261,7 +261,7 @@ const toggleEventFavorite = async () => {
261261
262262
await executeUrqlRequest({
263263
errorMessageI18n: t('favoriteDeleteError'),
264-
request: deleteEventFavoriteByIdMutation.executeMutation({
264+
request: deleteEventFavoriteByRowIdMutation.executeMutation({
265265
input: {
266266
id: event.eventFavoritesByEventId.nodes[0].id,
267267
},

src/app/components/form/FormContact.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
import { useVuelidate } from '@vuelidate/core'
164164
165165
import { useCreateContactMutation } from '~~/gql/documents/mutations/contact/contactCreate'
166-
import { useUpdateContactByIdMutation } from '~~/gql/documents/mutations/contact/contactUpdateById'
166+
import { useUpdateContactByRowIdMutation } from '~~/gql/documents/mutations/contact/contactUpdateByRowId'
167167
import type { ContactItemFragment } from '~~/gql/generated/graphql'
168168
169169
const { contact = undefined } = defineProps<{
@@ -208,8 +208,11 @@ const isFormSent = ref(false)
208208
209209
// api data
210210
const createContactMutation = useCreateContactMutation()
211-
const updateContactByIdMutation = useUpdateContactByIdMutation()
212-
const api = await useApiData([createContactMutation, updateContactByIdMutation])
211+
const updateContactByRowIdMutation = useUpdateContactByRowIdMutation()
212+
const api = await useApiData([
213+
createContactMutation,
214+
updateContactByRowIdMutation,
215+
])
213216
214217
// methods
215218
const submit = async () => {
@@ -224,7 +227,7 @@ const submit = async () => {
224227
225228
if (form.id) {
226229
// Edit
227-
const result = await updateContactByIdMutation.executeMutation({
230+
const result = await updateContactByRowIdMutation.executeMutation({
228231
id: form.id,
229232
contactPatch: {
230233
accountId: account?.id || null,

src/app/components/form/FormEvent.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
</template>
116116
</FormInput>
117117
<FormInput
118-
v-if="v$.visibility.$model === 'PUBLIC'"
118+
v-if="v$.visibility.$model === EventVisibility.Public"
119119
id-label="input-invitee-count-maximum"
120120
:title="t('maximumInviteeCount')"
121121
type="number"
@@ -275,7 +275,7 @@ import { useVuelidate } from '@vuelidate/core'
275275
import { DatePicker } from 'v-calendar'
276276
277277
import { useCreateEventMutation } from '~~/gql/documents/mutations/event/eventCreate'
278-
import { useUpdateEventByIdMutation } from '~~/gql/documents/mutations/event/eventUpdateById'
278+
import { useUpdateEventByRowIdMutation } from '~~/gql/documents/mutations/event/eventUpdateByRowId'
279279
import { EventVisibility } from '~~/gql/generated/graphql'
280280
import type { EventItemFragment } from '~~/gql/generated/graphql'
281281
@@ -326,7 +326,7 @@ const isFormSent = ref(false)
326326
327327
// api data
328328
const createEventMutation = useCreateEventMutation()
329-
const updateEventMutation = useUpdateEventByIdMutation()
329+
const updateEventMutation = useUpdateEventByRowIdMutation()
330330
const api = await useApiData([createEventMutation, updateEventMutation])
331331
332332
// methods

src/app/components/form/FormGuest.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ import { useCreateGuestsMutation } from '~~/gql/documents/mutations/guest/guestC
8989
import { useAllContactsQuery } from '~~/gql/documents/queries/contact/contactsAll'
9090
import type { EventItemFragment } from '~~/gql/generated/graphql'
9191
import { getContactItem } from '~~/gql/documents/fragments/contactItem'
92-
// import { accountByIdQuery } from '~~/gql/documents/queries/account/accountById'
92+
// import { accountByRowIdQuery } from '~~/gql/documents/queries/account/accountByRowId'
9393
// import { getAccountItem } from '~~/gql/documents/fragments/accountItem'
9494
9595
const { event, guestContactIdsExisting = undefined } = defineProps<{
@@ -188,7 +188,7 @@ const contactsFiltered = computed(() => {
188188
// // TODO: make more performant
189189
// const contactAccountQuery = contact.accountId
190190
// ? await $urql.value
191-
// .query(accountByIdQuery, {
191+
// .query(accountByRowIdQuery, {
192192
// id: contact.accountId,
193193
// })
194194
// .toPromise()
@@ -201,7 +201,7 @@ const contactsFiltered = computed(() => {
201201
// }
202202
203203
// const contactAccount = getAccountItem(
204-
// contactAccountQuery?.data?.accountById,
204+
// contactAccountQuery?.data?.accountByRowId,
205205
// )
206206
207207
// if (!contactAccount) {

src/app/components/guest/GuestFeedbackIcon.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<template>
22
<AppIconCheckCircleSolid
3-
v-if="feedback === 'ACCEPTED'"
3+
v-if="feedback === InvitationFeedback.Accepted"
44
class="text-green-600"
55
:title="t('feedbackAccepted')"
66
/>
77
<AppIconXCircleSolid
8-
v-else-if="feedback === 'CANCELED'"
8+
v-else-if="feedback === InvitationFeedback.Canceled"
99
class="text-(--semantic-critic-text)"
1010
:title="t('feedbackCanceled')"
1111
/>
@@ -19,8 +19,10 @@
1919
</template>
2020

2121
<script setup lang="ts">
22+
import { InvitationFeedback } from '~~/gql/generated/graphql'
23+
2224
const { feedback } = defineProps<{
23-
feedback: string
25+
feedback: string | null
2426
}>()
2527
2628
const { t } = useI18n()

0 commit comments

Comments
 (0)