Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/lowmess/az-golf-gurus. www.azgolfgurus.com
astro datocms typescript
Something went wrong. Try again.
832 B · 54 lines
TypeScript
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455import { request } from "#api/request";
type CalendarButton = { label: string; url: string;};
export type Instructor = { image?: { url: string; width: number; height: number; }; name: string; bio?: string; calendarButton?: CalendarButton;};
type InstructorsSection = { title: string; newStudentCalendarButton?: CalendarButton; instructors: Array<Instructor>;};
const getInstructorsSectionQuery = `query getInstructorsSection { instructorsSection { title newStudentCalendarButton { label url } instructors { image { url width height } name bio calendarButton { label url } } }}`;
export async function getInstructorsSection(): Promise<InstructorsSection> { const data = await request(getInstructorsSectionQuery);
return data.instructorsSection;}