schon/storefront/app/graphql/queries/standalone/feedbacks.ts
Alexandr SaVBaD Waltz 03dbafaf44 feat(storefront): add feedbacks query and composable for improved data handling
Introduced `GET_FEEDBACKS` GraphQL query and `useFeedbacks` composable to enable retrieval and management of feedback data. Enhanced type safety with new TypeScript interfaces for feedback responses. Updated `Product` fragment to reuse `Feedback` fragment for better modularity.

- Added `feedbacks.ts` query file with `GET_FEEDBACKS`.
- Created `useFeedbacks.ts` composable for reactive feedback fetching and state management.
- Updated GraphQL fragments and `products.fragment.ts` to include `Feedback` reusability.
- Enhanced API type definitions with `IFeedbacksResponse` for response handling.

This improves modularity, type safety, and provides a reusable approach for feedback data integration. No breaking changes.
2026-03-02 13:56:51 +03:00

32 lines
No EOL
622 B
TypeScript

import {FEEDBACK_FRAGMENT} from "@graphql/fragments/feedback.fragment";
export const GET_FEEDBACKS = gql`
query getFeedbacks (
$feedbackAfter: String,
$feedbackFirst: Int,
$userUuid: UUID,
$productUuid: UUID,
$orderBy: String,
$uuid: UUID
) {
brands(
after: $feedbackAfter,
first: $feedbackFirst,
userUuid: $userUuid,
productUuid: $productUuid,
orderBy: $orderBy,
uuid: $uuid
) {
edges {
node {
...Feedback
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
${FEEDBACK_FRAGMENT}
`;