diff --git a/.yarn/cache/@esbuild-win32-x64-npm-0.18.20-37a9ab2bda-8.zip b/.yarn/cache/@esbuild-win32-x64-npm-0.18.20-37a9ab2bda-8.zip deleted file mode 100644 index 768cc68f..00000000 Binary files a/.yarn/cache/@esbuild-win32-x64-npm-0.18.20-37a9ab2bda-8.zip and /dev/null differ diff --git a/README.md b/README.md index c4033664..f6caea24 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,16 @@ + This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). ## Getting Started -First, run the development server: + + +First, generate gql codes: +```bash + yarn generate +``` + +Then, run the development server: ```bash npm run dev diff --git a/src/api/notice/notice-server.ts b/src/api/notice/notice-server.ts index dc9edf75..4348c809 100644 --- a/src/api/notice/notice-server.ts +++ b/src/api/notice/notice-server.ts @@ -14,11 +14,5 @@ export const getAllNotices = async ( Authorization: `Bearer ${cookieStore.get('access_token')?.value}`, }, }) - .then(({ data }) => ({ - ...data, - list: data.list.map(({ imageUrl, ...notice }) => ({ - ...notice, - imageUrl: imageUrl ? imageUrl : null, - })), - })); + .then((res) => res.data); }; diff --git a/src/api/notice/notice.ts b/src/api/notice/notice.ts index 443ba181..70c09c2c 100644 --- a/src/api/notice/notice.ts +++ b/src/api/notice/notice.ts @@ -23,7 +23,7 @@ export interface NoticeSearchParams { my?: 'own' | 'reminders'; } -interface NoticeBase { +export interface Notice { id: number; views: number; currentDeadline?: dayjs.Dayjs | string | null; @@ -34,8 +34,8 @@ interface NoticeBase { tags: Tag[]; logName?: string; contents: Content[]; + imagesUrl: string[]; files?: NoticeFile[] | null; - body: string; } export interface Content { @@ -62,12 +62,7 @@ export interface Tag { name: string; } -export interface Notice extends NoticeBase { - imageUrl: string | null; -} - -export interface NoticeDetail extends NoticeBase { - imagesUrl: string[]; +export interface NoticeDetail extends Notice { reminder: boolean; authorId: string; } @@ -82,10 +77,9 @@ export const getAllNotices = async ( ) => api.get('/notice', { params }).then(({ data }) => ({ ...data, - list: data.list.map(({ imageUrl, currentDeadline, ...notice }) => ({ + list: data.list.map(({ currentDeadline, ...notice }) => ({ ...notice, currentDeadline: currentDeadline ?? null, - imageUrl: imageUrl ?? null, contents: notice.contents.map(({ deadline, ...content }) => ({ ...content, deadline: deadline ?? null, @@ -109,13 +103,12 @@ export const GET_NOTICES = gql(` list { id views - body currentDeadline createdAt updatedAt deletedAt author - imageUrl + imagesUrl tags { id name diff --git a/src/app/api/graphql/schema.graphql b/src/app/api/graphql/schema.graphql index e6f2f7cb..60c93563 100644 --- a/src/app/api/graphql/schema.graphql +++ b/src/app/api/graphql/schema.graphql @@ -27,14 +27,13 @@ type NoticeFile { type Notice { id: Int! views: Int! - body: String! currentDeadline: Date createdAt: Date! updatedAt: Date! deletedAt: Date author: String! tags: [Tag!]! - imageUrl: String + imagesUrl: [String!]! contents: [Content!]! files: [NoticeFile!] } @@ -42,7 +41,6 @@ type Notice { type DetailedNotice { id: Int! views: Int! - body: String! currentDeadline: Date createdAt: Date! updatedAt: Date! diff --git a/src/app/components/organisms/Zabo/ImageZabo.stories.tsx b/src/app/components/organisms/Zabo/ImageZabo.stories.tsx index 94fec80e..7ef195a3 100644 --- a/src/app/components/organisms/Zabo/ImageZabo.stories.tsx +++ b/src/app/components/organisms/Zabo/ImageZabo.stories.tsx @@ -16,7 +16,7 @@ const Template: StoryFn = (args) => { return ; }; const args = { - imageUrl: 'https://picsum.photos/200/300', + imagesUrl: ['https://picsum.photos/200/300'], title: '23년도 인포팀 신규 부원 모집', content: '인포팀에서는 23년도 신규 부원을 모집합니다. 많은 지원 바랍니다.', createdAt: dayjs('2023-02-14T11:57:18.740Z'), diff --git a/src/app/components/organisms/Zabo/ImageZabo.tsx b/src/app/components/organisms/Zabo/ImageZabo.tsx index bcbb9fea..78e9d225 100644 --- a/src/app/components/organisms/Zabo/ImageZabo.tsx +++ b/src/app/components/organisms/Zabo/ImageZabo.tsx @@ -6,10 +6,10 @@ import { PropsWithLng } from '@/app/i18next'; import getLocaleContents from '@/utils/getLocaleContents'; import DDay from '../../molecules/DDay'; -import { ImageZaboProps, ZaboOrigin, ZaboSize } from './Zabo'; +import { ZaboOrigin, ZaboProps, ZaboSize } from './Zabo'; const ImageZabo = ({ - imageUrl, + imagesUrl, contents, createdAt, views, @@ -19,7 +19,7 @@ const ImageZabo = ({ width, height, lng, -}: ImageZaboProps & PropsWithLng) => { +}: ZaboProps & PropsWithLng) => { const localContents = getLocaleContents(contents, lng); const deadline = rawDeadline ? dayjs(rawDeadline) : undefined; @@ -37,7 +37,7 @@ const ImageZabo = ({ } > ({ contents, @@ -17,7 +17,7 @@ const TextZabo = ({ height, width, lng, -}: TextZaboProps & PropsWithLng) => { +}: ZaboProps & PropsWithLng) => { const deadline = rawDeadline ? dayjs(rawDeadline) : undefined; const origin = width ? 'width' : 'height'; const antiOrigin = width ? 'height' : 'width'; diff --git a/src/app/components/organisms/Zabo/Zabo.tsx b/src/app/components/organisms/Zabo/Zabo.tsx index 24a29b15..a6c3e4a3 100644 --- a/src/app/components/organisms/Zabo/Zabo.tsx +++ b/src/app/components/organisms/Zabo/Zabo.tsx @@ -16,24 +16,16 @@ export type ZaboProps = PropsWithT< Notice & ZaboSize >; -export type ImageZaboProps = ZaboProps & { - imageUrl: string; -}; - -export type TextZaboProps = ZaboProps; - const Zabo = ( - props: IsImage extends true - ? ImageZaboProps & PropsWithLng - : TextZaboProps & PropsWithLng, + props: ZaboProps & PropsWithLng, ) => - 'imageUrl' in props && props.imageUrl && props.imageUrl.length > 0 ? ( + props.imagesUrl.length > 0 ? ( & PropsWithLng)} - imageUrl={props.imageUrl || ''} + {...(props as ZaboProps & PropsWithLng)} + imagesUrl={props.imagesUrl} /> ) : ( - & PropsWithLng)} /> + & PropsWithLng)} /> ); export default Zabo; diff --git a/src/app/components/templates/HowAboutThese/HowAboutThese.tsx b/src/app/components/templates/HowAboutThese/HowAboutThese.tsx index 94d8baa4..d2c58464 100644 --- a/src/app/components/templates/HowAboutThese/HowAboutThese.tsx +++ b/src/app/components/templates/HowAboutThese/HowAboutThese.tsx @@ -20,14 +20,7 @@ const HowAboutThese = ({ lng }: PropsWithLng) => { variables: { offset: 0, limit: ITEMS_PER_CALL }, }); - const notices = useMemo( - () => - data?.notices.list.map(({ imageUrl, ...notice }) => ({ - ...notice, - imageUrl: imageUrl ?? null, - })) ?? [], - [data], - ); + const notices = useMemo(() => data?.notices.list ?? [], [data]); useEffect(() => { const observer = new IntersectionObserver( diff --git a/src/app/components/templates/ResultZabo/ResultImageZabo.tsx b/src/app/components/templates/ResultZabo/ResultImageZabo.tsx index 47dc596c..a40fedb9 100644 --- a/src/app/components/templates/ResultZabo/ResultImageZabo.tsx +++ b/src/app/components/templates/ResultZabo/ResultImageZabo.tsx @@ -11,7 +11,7 @@ import getLocaleContents from '@/utils/getLocaleContents'; import HighlightedText from '../../molecules/HighlightedText'; import ZaboImage from '../../molecules/ZaboImage'; import Tags from '../../organisms/Tags'; -import { ResultImageZaboProps } from './ResultZabo'; +import { ResultZaboProps } from './ResultZabo'; const ResultImageZabo = async ({ contents, @@ -21,11 +21,10 @@ const ResultImageZabo = async ({ currentDeadline, tags, searchQuery, - - imageUrl, + imagesUrl, id, lng, -}: ResultImageZaboProps) => { +}: ResultZaboProps) => { const { t } = await createTranslation(lng); const localeContents = getLocaleContents(contents, lng); @@ -37,7 +36,7 @@ const ResultImageZabo = async ({
diff --git a/src/app/components/templates/ResultZabo/ResultTextZabo.tsx b/src/app/components/templates/ResultZabo/ResultTextZabo.tsx index 22a1e21b..ae56baa6 100644 --- a/src/app/components/templates/ResultZabo/ResultTextZabo.tsx +++ b/src/app/components/templates/ResultZabo/ResultTextZabo.tsx @@ -13,7 +13,6 @@ import { ResultZaboProps } from './ResultZabo'; const ResultTextZabo = async ({ contents, - body, createdAt, views, author, diff --git a/src/app/components/templates/ResultZabo/ResultZabo.tsx b/src/app/components/templates/ResultZabo/ResultZabo.tsx index ff48cf33..32d692b0 100644 --- a/src/app/components/templates/ResultZabo/ResultZabo.tsx +++ b/src/app/components/templates/ResultZabo/ResultZabo.tsx @@ -15,17 +15,11 @@ export type ResultZaboProps = PropsWithLng< } >; -export type ResultImageZaboProps = ResultZaboProps & { - imageUrl: string; -}; - -export type ResultTextZaboProps = ResultZaboProps; - const ResultZabo = (props: ResultZaboProps) => { - return props.imageUrl ? ( - + return props.imagesUrl.length > 0 ? ( // image exists in zabo + ) : ( - + ); }; diff --git a/src/app/components/templates/SearchResults/SearchResults.tsx b/src/app/components/templates/SearchResults/SearchResults.tsx index eff161d1..5579eff2 100644 --- a/src/app/components/templates/SearchResults/SearchResults.tsx +++ b/src/app/components/templates/SearchResults/SearchResults.tsx @@ -33,7 +33,7 @@ const Results = async ({ event="search_result_click" properties={{ location: 'SearchPage', - isText: notice.imageUrl === null, + isText: notice.imagesUrl.length === 0, }} key={notice.id} > diff --git a/src/app/components/templates/ZaboCarousel/ZaboCarousel.stories.tsx b/src/app/components/templates/ZaboCarousel/ZaboCarousel.stories.tsx index 5d2784f9..5ae9b612 100644 --- a/src/app/components/templates/ZaboCarousel/ZaboCarousel.stories.tsx +++ b/src/app/components/templates/ZaboCarousel/ZaboCarousel.stories.tsx @@ -15,7 +15,7 @@ Default.args = { notices: [ { id: 1, - imageUrl: 'https://picsum.photos/200/300', + imagesUrl: ['https://picsum.photos/200/300'], contents: [ { id: 1, @@ -40,13 +40,12 @@ Default.args = { updatedAt: dayjs('2023-02-14T11:57:18.740Z'), views: 110, author: '이정우', - body: '', tags: [], files: [], }, { id: 2, - imageUrl: 'https://picsum.photos/200/300', + imagesUrl: ['https://picsum.photos/200/300'], contents: [ { id: 1, @@ -71,13 +70,12 @@ Default.args = { updatedAt: dayjs('2023-02-14T11:57:18.740Z'), views: 110, author: '이정우', - body: '', tags: [], files: [], }, { id: 3, - imageUrl: 'https://picsum.photos/200/300', + imagesUrl: ['https://picsum.photos/200/300'], contents: [ { id: 1, @@ -102,13 +100,12 @@ Default.args = { updatedAt: dayjs('2023-02-14T11:57:18.740Z'), views: 110, author: '이정우', - body: '', tags: [], files: [], }, { id: 4, - imageUrl: 'https://picsum.photos/200/300', + imagesUrl: ['https://picsum.photos/200/300'], contents: [ { id: 1, @@ -133,13 +130,12 @@ Default.args = { updatedAt: dayjs('2023-02-14T11:57:18.740Z'), views: 110, author: '이정우', - body: '', tags: [], files: [], }, { id: 5, - imageUrl: 'https://picsum.photos/200/300', + imagesUrl: ['https://picsum.photos/200/300'], contents: [ { id: 1, @@ -164,13 +160,12 @@ Default.args = { updatedAt: dayjs('2023-02-14T11:57:18.740Z'), views: 110, author: '이정우', - body: '', tags: [], files: [], }, { id: 6, - imageUrl: 'https://picsum.photos/200/300', + imagesUrl: ['https://picsum.photos/200/300'], contents: [ { id: 1, @@ -195,13 +190,12 @@ Default.args = { updatedAt: dayjs('2023-02-14T11:57:18.740Z'), views: 110, author: '이정우', - body: '', tags: [], files: [], }, { id: 7, - imageUrl: 'https://picsum.photos/200/300', + imagesUrl: ['https://picsum.photos/200/300'], contents: [ { id: 1, @@ -226,13 +220,12 @@ Default.args = { updatedAt: dayjs('2023-02-14T11:57:18.740Z'), views: 110, author: '이정우', - body: '', tags: [], files: [], }, { id: 8, - imageUrl: 'https://picsum.photos/200/300', + imagesUrl: ['https://picsum.photos/200/300'], contents: [ { id: 1, @@ -257,7 +250,6 @@ Default.args = { updatedAt: dayjs('2023-02-14T11:57:18.740Z'), views: 110, author: '이정우', - body: '', tags: [], files: [], }, diff --git a/src/generated/gql.ts b/src/generated/gql.ts index d9279c9c..24e631c5 100644 --- a/src/generated/gql.ts +++ b/src/generated/gql.ts @@ -13,7 +13,7 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ * Therefore it is highly recommended to use the babel or swc plugin for production. */ const documents = { - "\n query GetNotices($offset: Int, $limit: Int) {\n notices(offset: $offset, limit: $limit, orderBy: RECENT) {\n list {\n id\n views\n body\n currentDeadline\n createdAt\n updatedAt\n deletedAt\n author\n imageUrl\n tags {\n id\n name\n }\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n total\n }\n }\n": types.GetNoticesDocument, + "\n query GetNotices($offset: Int, $limit: Int) {\n notices(offset: $offset, limit: $limit, orderBy: RECENT) {\n list {\n id\n views\n currentDeadline\n createdAt\n updatedAt\n deletedAt\n author\n imagesUrl\n tags {\n id\n name\n }\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n total\n }\n }\n": types.GetNoticesDocument, "\n mutation CreateNotice($title: String!, $body: String!, $deadline: Date, $tags: [Int!], $images: [String!]) {\n createNotice(title: $title, body: $body, deadline: $deadline, tags: $tags, images: $images) {\n id\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n }\n": types.CreateNoticeDocument, "\n mutation AttachInternationalNotice($title: String!, $body: String!, $deadline: Date, $noticeId: Int!, $contentId: Int!, $lang: String!) {\n attachInternationalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId, contentId: $contentId, lang: $lang) {\n id\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n }\n }\n }\n": types.AttachInternationalNoticeDocument, "\n mutation CreateAdditionalNotice($title: String, $body: String!, $deadline: Date, $noticeId: Int!) {\n createAdditionalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId) {\n id\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n }\n": types.CreateAdditionalNoticeDocument, @@ -37,7 +37,7 @@ export function gql(source: string): unknown; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function gql(source: "\n query GetNotices($offset: Int, $limit: Int) {\n notices(offset: $offset, limit: $limit, orderBy: RECENT) {\n list {\n id\n views\n body\n currentDeadline\n createdAt\n updatedAt\n deletedAt\n author\n imageUrl\n tags {\n id\n name\n }\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n total\n }\n }\n"): (typeof documents)["\n query GetNotices($offset: Int, $limit: Int) {\n notices(offset: $offset, limit: $limit, orderBy: RECENT) {\n list {\n id\n views\n body\n currentDeadline\n createdAt\n updatedAt\n deletedAt\n author\n imageUrl\n tags {\n id\n name\n }\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n total\n }\n }\n"]; +export function gql(source: "\n query GetNotices($offset: Int, $limit: Int) {\n notices(offset: $offset, limit: $limit, orderBy: RECENT) {\n list {\n id\n views\n currentDeadline\n createdAt\n updatedAt\n deletedAt\n author\n imagesUrl\n tags {\n id\n name\n }\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n total\n }\n }\n"): (typeof documents)["\n query GetNotices($offset: Int, $limit: Int) {\n notices(offset: $offset, limit: $limit, orderBy: RECENT) {\n list {\n id\n views\n currentDeadline\n createdAt\n updatedAt\n deletedAt\n author\n imagesUrl\n tags {\n id\n name\n }\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n total\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/src/generated/graphql.ts b/src/generated/graphql.ts index 67e3674f..0f18610b 100644 --- a/src/generated/graphql.ts +++ b/src/generated/graphql.ts @@ -32,7 +32,6 @@ export type DetailedNotice = { __typename?: 'DetailedNotice'; author: Scalars['String']['output']; authorId: Scalars['String']['output']; - body: Scalars['String']['output']; contents: Array; createdAt: Scalars['Date']['output']; currentDeadline?: Maybe; @@ -94,14 +93,13 @@ export type MutationDeleteNoticeArgs = { export type Notice = { __typename?: 'Notice'; author: Scalars['String']['output']; - body: Scalars['String']['output']; contents: Array; createdAt: Scalars['Date']['output']; currentDeadline?: Maybe; deletedAt?: Maybe; files?: Maybe>; id: Scalars['Int']['output']; - imageUrl?: Maybe; + imagesUrl: Array; tags: Array; updatedAt: Scalars['Date']['output']; views: Scalars['Int']['output']; @@ -162,7 +160,7 @@ export type GetNoticesQueryVariables = Exact<{ }>; -export type GetNoticesQuery = { __typename?: 'Query', notices: { __typename?: 'Notices', total: number, list: Array<{ __typename?: 'Notice', id: number, views: number, body: string, currentDeadline?: any | null, createdAt: any, updatedAt: any, deletedAt?: any | null, author: string, imageUrl?: string | null, tags: Array<{ __typename?: 'Tag', id: number, name: string }>, contents: Array<{ __typename?: 'Content', id: number, lang: string, title: string, body: string, deadline?: any | null, createdAt: any, noticeId: number }> }> } }; +export type GetNoticesQuery = { __typename?: 'Query', notices: { __typename?: 'Notices', total: number, list: Array<{ __typename?: 'Notice', id: number, views: number, currentDeadline?: any | null, createdAt: any, updatedAt: any, deletedAt?: any | null, author: string, imagesUrl: Array, tags: Array<{ __typename?: 'Tag', id: number, name: string }>, contents: Array<{ __typename?: 'Content', id: number, lang: string, title: string, body: string, deadline?: any | null, createdAt: any, noticeId: number }> }> } }; export type CreateNoticeMutationVariables = Exact<{ title: Scalars['String']['input']; @@ -205,7 +203,7 @@ export type DeleteNoticeMutationVariables = Exact<{ export type DeleteNoticeMutation = { __typename?: 'Mutation', deleteNotice: boolean }; -export const GetNoticesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetNotices"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"offset"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notices"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"offset"},"value":{"kind":"Variable","name":{"kind":"Name","value":"offset"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"EnumValue","value":"RECENT"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"list"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"views"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"currentDeadline"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"author"}},{"kind":"Field","name":{"kind":"Name","value":"imageUrl"}},{"kind":"Field","name":{"kind":"Name","value":"tags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"contents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"lang"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"noticeId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"total"}}]}}]}}]} as unknown as DocumentNode; +export const GetNoticesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetNotices"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"offset"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notices"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"offset"},"value":{"kind":"Variable","name":{"kind":"Name","value":"offset"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"EnumValue","value":"RECENT"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"list"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"views"}},{"kind":"Field","name":{"kind":"Name","value":"currentDeadline"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"author"}},{"kind":"Field","name":{"kind":"Name","value":"imagesUrl"}},{"kind":"Field","name":{"kind":"Name","value":"tags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"contents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"lang"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"noticeId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"total"}}]}}]}}]} as unknown as DocumentNode; export const CreateNoticeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateNotice"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"title"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"body"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Date"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"tags"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"images"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createNotice"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"title"},"value":{"kind":"Variable","name":{"kind":"Name","value":"title"}}},{"kind":"Argument","name":{"kind":"Name","value":"body"},"value":{"kind":"Variable","name":{"kind":"Name","value":"body"}}},{"kind":"Argument","name":{"kind":"Name","value":"deadline"},"value":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}}},{"kind":"Argument","name":{"kind":"Name","value":"tags"},"value":{"kind":"Variable","name":{"kind":"Name","value":"tags"}}},{"kind":"Argument","name":{"kind":"Name","value":"images"},"value":{"kind":"Variable","name":{"kind":"Name","value":"images"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"lang"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"noticeId"}}]}}]}}]}}]} as unknown as DocumentNode; export const AttachInternationalNoticeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AttachInternationalNotice"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"title"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"body"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Date"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"contentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"lang"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attachInternationalNotice"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"title"},"value":{"kind":"Variable","name":{"kind":"Name","value":"title"}}},{"kind":"Argument","name":{"kind":"Name","value":"body"},"value":{"kind":"Variable","name":{"kind":"Name","value":"body"}}},{"kind":"Argument","name":{"kind":"Name","value":"deadline"},"value":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}}},{"kind":"Argument","name":{"kind":"Name","value":"noticeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}}},{"kind":"Argument","name":{"kind":"Name","value":"contentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"contentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"lang"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"lang"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}}]} as unknown as DocumentNode; export const CreateAdditionalNoticeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateAdditionalNotice"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"title"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"body"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Date"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createAdditionalNotice"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"title"},"value":{"kind":"Variable","name":{"kind":"Name","value":"title"}}},{"kind":"Argument","name":{"kind":"Name","value":"body"},"value":{"kind":"Variable","name":{"kind":"Name","value":"body"}}},{"kind":"Argument","name":{"kind":"Name","value":"deadline"},"value":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}}},{"kind":"Argument","name":{"kind":"Name","value":"noticeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"lang"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"noticeId"}}]}}]}}]}}]} as unknown as DocumentNode; diff --git a/src/generated/server.ts b/src/generated/server.ts index c9714eb1..8019e1d2 100644 --- a/src/generated/server.ts +++ b/src/generated/server.ts @@ -33,7 +33,6 @@ export type DetailedNotice = { __typename?: 'DetailedNotice'; author: Scalars['String']['output']; authorId: Scalars['String']['output']; - body: Scalars['String']['output']; contents: Array; createdAt: Scalars['Date']['output']; currentDeadline?: Maybe; @@ -95,14 +94,13 @@ export type MutationDeleteNoticeArgs = { export type Notice = { __typename?: 'Notice'; author: Scalars['String']['output']; - body: Scalars['String']['output']; contents: Array; createdAt: Scalars['Date']['output']; currentDeadline?: Maybe; deletedAt?: Maybe; files?: Maybe>; id: Scalars['Int']['output']; - imageUrl?: Maybe; + imagesUrl: Array; tags: Array; updatedAt: Scalars['Date']['output']; views: Scalars['Int']['output']; @@ -278,7 +276,6 @@ export interface DateScalarConfig extends GraphQLScalarTypeConfig = { author?: Resolver; authorId?: Resolver; - body?: Resolver; contents?: Resolver, ParentType, ContextType>; createdAt?: Resolver; currentDeadline?: Resolver, ParentType, ContextType>; @@ -302,14 +299,13 @@ export type MutationResolvers = { author?: Resolver; - body?: Resolver; contents?: Resolver, ParentType, ContextType>; createdAt?: Resolver; currentDeadline?: Resolver, ParentType, ContextType>; deletedAt?: Resolver, ParentType, ContextType>; files?: Resolver>, ParentType, ContextType>; id?: Resolver; - imageUrl?: Resolver, ParentType, ContextType>; + imagesUrl?: Resolver, ParentType, ContextType>; tags?: Resolver, ParentType, ContextType>; updatedAt?: Resolver; views?: Resolver; diff --git a/src/mock/dummy-mypage-articles.ts b/src/mock/dummy-mypage-articles.ts index 54dacdea..23444ecd 100644 --- a/src/mock/dummy-mypage-articles.ts +++ b/src/mock/dummy-mypage-articles.ts @@ -24,7 +24,7 @@ const articles1 = [ body: '', deadline: '', id: 0, - imageUrl: null, + imagesUrl: [], tags: [], views: 0, })); @@ -40,7 +40,7 @@ const articles2 = [ body: '', deadline: '', id: 0, - imageUrl: null, + imagesUrl: [], tags: [], views: 0, }));