new schema for event v.3

This commit is contained in:
José Salazar
2025-11-25 12:03:32 -05:00
parent 352adfed1c
commit 25fd4e1f18
18 changed files with 4046 additions and 508 deletions

View File

@@ -12,11 +12,9 @@ For each operation, there is a wrapper hook that can be used to call the operati
Here are all of the hooks that get generated:
```ts
import { useListEvents, useCreateStaff, useListStaff, useCreateVendor, useUpdateVendor, useDeleteVendor, useListVendor, useGetVendorById, useFilterVendors, useCreateEvent } from '@dataconnect/generated/react';
import { useCreateStaff, useListStaff, useCreateVendor, useUpdateVendor, useDeleteVendor, useListVendor, useGetVendorById, useFilterVendors, useCreateEvent, useUpdateEvent } from '@dataconnect/generated/react';
// The types of these hooks are available in react/index.d.ts
const { data, isPending, isSuccess, isError, error } = useListEvents();
const { data, isPending, isSuccess, isError, error } = useCreateStaff(createStaffVars);
const { data, isPending, isSuccess, isError, error } = useListStaff();
@@ -35,6 +33,8 @@ const { data, isPending, isSuccess, isError, error } = useFilterVendors(filterVe
const { data, isPending, isSuccess, isError, error } = useCreateEvent(createEventVars);
const { data, isPending, isSuccess, isError, error } = useUpdateEvent(updateEventVars);
```
Here's an example from a different generated SDK:
@@ -72,12 +72,9 @@ If a user is not using a supported framework, they can use the generated SDK dir
Here's an example of how to use it with the first 5 operations:
```js
import { listEvents, createStaff, listStaff, createVendor, updateVendor, deleteVendor, listVendor, getVendorById, filterVendors, createEvent } from '@dataconnect/generated';
import { createStaff, listStaff, createVendor, updateVendor, deleteVendor, listVendor, getVendorById, filterVendors, createEvent, updateEvent } from '@dataconnect/generated';
// Operation listEvents:
const { data } = await ListEvents(dataConnect);
// Operation CreateStaff: For variables, look at type CreateStaffVars in ../index.d.ts
const { data } = await CreateStaff(dataConnect, createStaffVars);
@@ -105,5 +102,8 @@ const { data } = await FilterVendors(dataConnect, filterVendorsVars);
// Operation CreateEvent: For variables, look at type CreateEventVars in ../index.d.ts
const { data } = await CreateEvent(dataConnect, createEventVars);
// Operation UpdateEvent: For variables, look at type UpdateEventVars in ../index.d.ts
const { data } = await UpdateEvent(dataConnect, updateEventVars);
```