Refactored multiple files for code styling consistency, using proper indentation and spacing to align with team standards. Improved readability and maintainability across composables, Apollo plugin, and localization files. Enhancements: - Standardized import and function indentation across all composables. - Updated `biome.json` schema to the latest version (v2.4.4) for tool compatibility. - Organized code blocks in Apollo plugin for better understandability. No functional changes introduced—this is a non-breaking, code refinement commit.
18 lines
382 B
TypeScript
18 lines
382 B
TypeScript
import { GET_POSTS } from '@graphql/queries/standalone/blog';
|
|
import type { IPostResponse } from '@types';
|
|
|
|
export function usePosts() {
|
|
const { data, error } = useAsyncQuery<IPostResponse>(GET_POSTS);
|
|
|
|
const posts = computed(() => data.value?.posts.edges ?? []);
|
|
|
|
watch(error, (err) => {
|
|
if (err) {
|
|
console.error('usePosts error:', err);
|
|
}
|
|
});
|
|
|
|
return {
|
|
posts,
|
|
};
|
|
}
|