Files
supabase/examples/caching/with-react-query-nextjs-14/queries/get-country-by-id.ts
Thor 雷神 SchaeffandPhilipp Steinrötter 34a016b4c2 feat(blog): Add React Query post. (#20254)
* feat(blog): Add React Query post.

* feat(examples): Add React Query example.

* Apply suggestions from code review

Thank you 💚

Co-authored-by: Philipp Steinrötter <philipp@steinroetter.com>

* chore: update og image.

---------

Co-authored-by: Philipp Steinrötter <philipp@steinroetter.com>
2024-01-12 10:30:48 +00:00

16 lines
288 B
TypeScript

import { TypedSupabaseClient } from '@/utils/types'
export function getCountryById(client: TypedSupabaseClient, countryId: number) {
return client
.from('countries')
.select(
`
id,
name
`
)
.eq('id', countryId)
.throwOnError()
.single()
}