express 로 GraphQL 사용하였을 때 코드는 아래와 같습니다. const typeDefs = `#graphql input CreateBoardInput { writer: String title: String contents: String } type Mutation { createBoard(createBoardInput: CreateBoardInput!): String } `; const resolvers = { Mutation: { createBoard: (parent, args, context, info) => { ... return "게시글 등록 성공" } } 위 내용을 Nest.js - GraphQL 에 적용하였을 때 아래와 같이 구현했습니다. @Mutation(() => String) createBoard( @Args('createBoardInput') createBoardInput: CreateBoardInput, ): string { // 1. 브라우저에서 보내준 Data 확인하기 console.log(createBoardInput.writer); console.log(createBoardInput.title); console.log(createBoardInput.contents); // 2. DB접속 후, 데이터 저장 => 데이터 저장했다고 가정 // 3. DB에 저장된 결과를 브라우저에 응답(response) 주기 return '게시글 등록 성공'; } @InputType() export class CreateBoardInput { // export 추가 및 클래스 이름 변경 @Field(() => String) writer: string; @Field(() => String) title: string; @Field(() => String, { nullable: true }) contents: string; } @InputType() 데코레이터: CreateBoardInput 클래스에 @InputType() 데코레이터를 적용하여, 이 클래스가 GraphQL 스키마에서 입력 타입으로 적용되게 되는데요. InputType 데코레이터의 경우 class 파일 위에 존재해야 한다고 합니다. 지금처럼 InputType이 늘어날때마다 class 를 추가하나요? 실무에서는 어떻게 사용하나요?
강의 영상 대로 작성 후 systemctl restart redis-server실행시 아래와 같은 오류가 나옵니다...(sutdy를 server로했습니다.) Job for redis-server.service failed because a timeout was exceeded. See "systemctl status redis-server.service" and "journalctl -xeu redis-server.service" for details. journalctl를 실행해봤더니 아래에 대한 내용이 나오네요, 강의에 나온 service 내용을 그대로 쳤는데도 이런 오류가나오네요.... 4월 16 23:03:30 localhost .localdomain systemd[1]: Starting My resdis study... ░░ Subject: A start job for unit redis-server.service has begun execution ░░ Defined-By: systemd ░░ Support: https://wiki.rockylinux.org/rocky/support ░░ ░░ A start job for unit redis-server.service has begun execution. ░░ ░░ The job identifier is 4223. 4월 16 23:03:30 localhost .localdomain redis-server[31478]: 31478:C 16 Apr 2025 23:03:30.725 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cau> 4월 16 23:03:30 localhost .localdomain redis-server[31478]: 31478:C 16 Apr 2025 23:03:30.726 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 4월 16 23:03:30 localhost .localdomain redis-server[31478]: 31478:C 16 Apr 2025 23:03:30.726 * Redis version=7.4.2, bits=64, commit=00000000, modified=0, pid=31478, just started 4월 16 23:03:30 localhost .localdomain redis-server[31478]: 31478:C 16 Apr 2025 23:03:30.726 * Configuration loaded 4월 16 23:03:30 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:03:30.726 * Increased maximum number of open files to 10032 (it was originally set to 1024). 4월 16 23:03:30 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:03:30.726 * monotonic clock: POSIX clock_gettime 4월 16 23:03:30 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:03:30.727 * Running mode=standalone, port=6379. 4월 16 23:03:30 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:03:30.728 * Server initialized 4월 16 23:03:30 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:03:30.728 * Loading RDB produced by version 7.4.2 4월 16 23:03:30 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:03:30.728 * RDB age 11 seconds 4월 16 23:03:30 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:03:30.728 * RDB memory usage when created 0.93 Mb 4월 16 23:03:30 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:03:30.728 * Done loading RDB, keys loaded: 0, keys expired: 0. 4월 16 23:03:30 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:03:30.728 * DB loaded from disk: 0.000 seconds 4월 16 23:03:30 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:03:30.728 * Ready to accept connections tcp 4월 16 23:05:00 localhost .localdomain systemd[1]: redis-server.service: start operation timed out. Terminating. 4월 16 23:05:00 localhost .localdomain redis-server[31478]: 31478:signal-handler (1744812300) Received SIGTERM scheduling shutdown... 4월 16 23:05:00 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:05:00.778 * User requested shutdown... 4월 16 23:05:00 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:05:00.778 * Saving the final RDB snapshot before exiting. 4월 16 23:05:00 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:05:00.781 * DB saved on disk 4월 16 23:05:00 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:05:00.781 * Removing the pid file. 4월 16 23:05:00 localhost .localdomain redis-server[31478]: 31478:M 16 Apr 2025 23:05:00.781 # Redis is now ready to exit, bye bye... 4월 16 23:05:00 localhost .localdomain systemd[1]: redis-server.service: Failed with result 'timeout'. ░░ Subject: Unit failed ░░ Defined-By: systemd ░░ Support: https://wiki.rockylinux.org/rocky/support ░░ ░░ The unit redis-server.service has entered the 'failed' state with result 'timeout'.
안녕하세요! 강의 듣다가 최종 배포에서 질문이 있습니다. 강의에서는 vite.config.js 파일 내용 수정은 없는 것 같은데요 아래 순서로 했는데 홈페이지 메인화면에서 Blocked request. This host (" 5d39-218-159-221-155.ngrok-free.app ") is not allowed. To allow this host, add " 5d39-218-159-221-155.ngrok-free.app " to server.allowedHosts in vite.config.js. 에러가 뜨는데요 vite.config.js 파일 수정을 해야되나요? 프론트, 백앤드 서버 실행 cmd 창에서 ngrok http 5173 입력 index.js 파일에서 아래와 같이 수정 app.use(cors({ //origin: "http://localhost:5173", origin: "https://5d39-218-159-221-155.ngrok-free.app", credentials: true, })); ngrok 에러는 아래와 같아요 08:36:45.923 KST GET /favicon.ico 403 Forbidden
의존성 배열에 보통 배열이나 객체를 넣지 않는 게 좋다고 어디서 본거 같은데 useState으로 만든 객체나 배열은 상관이 없고 const a = {a: 1, b:2} 이런 거나 const b = []; 이렇게 초기화 된 것들만 넣지 말라고 하는 것인가요? 맞다면 이유는 const a 랑 const b는 리렌더 될 때마다 참조 값이 바뀌고 useState으로 만든 것은 리렌더링이 되어도 set 함수가 쓰이지 않는 이상 참조 값이 바뀌지 않아서 그런 건가요?
const promise = new Promise((resolve, reject) => { // 비동기 작업을 실행하는 함수 // executor setTimeout(() => { console.log("안녕"); // resolve(); reject(); }, 2000); }); console.log(promise); setTimeout(() => { console.log(promise); }, 3000); 첫 번째 console.log와 setTimeout에서의 두 번째 console.log는 promise객체의 상태가 달라야 한다고 생각하는데 왜 같은지가 궁금합니다.
TypeORM과 mysql을 사용하여 실습하시는 분들은 아래와 같이 Entity 정의에 'class-transformer' 라이브러리에 있는 '@Exclude()' 데코레이터와 'instanceToPlain' 메서드를 사용하여 password 노출을 막을 수 있습니다. 위 사진처럼 Entity 파일에 @Exclude() 사용 고양이 데이터를 불러오는 서비스(getCurrentCat) 로직에서 위와 같이 instanceToPlain을 사용하시면 됩니다!
[제로초 강좌 질문 필독 사항입니다] 질문에는 여러분에게 도움이 되는 질문과 도움이 되지 않는 질문이 있습니다. 도움이 되는 질문을 하는 방법을 알려드립니다. https://inf.run/Qs2vt 0. 숫자 0부터 시작한 이유는 1보다 더 중요한 것이기 때문입니다. 에러가 났을 때 해결을 하는 게 중요한 게 아닙니다. 왜 여러분은 해결을 못 하고 저는 해결을 하는지, 어디서 힌트를 얻은 것이고 어떻게 해결한 건지 그걸 알아가셔야 합니다. 그렇지 못한 질문은 무의미한 질문입니다. 1. 에러 메시지를 올리기 전에 반드시 스스로 번역을 해야 합니다. 번역기 요즘 잘 되어 있습니다. 에러 메시지가 에러 해결 단서의 90%를 차지합니다. 한글로 번역만 해도 대부분 풀립니다. 그냥 에러메시지를 올리고(심지어 안 올리는 분도 있습니다. 저는 독심술사가 아닙니다) 해결해달라고 하시면 아무런 도움이 안 됩니다. 2. 에러 메시지를 잘라서 올리지 않아야 합니다. 입문자일수록 에러메시지에서 어떤 부분이 가장 중요한 부분인지 모르실 겁니다. 그러니 통째로 올리셔야 합니다. 3. 코드도 같이 올려주세요. 다만 코드 전체를 다 올리거나, 깃헙 주소만 띡 던지지는 마세요. 여러분이 "가장" 의심스럽다고 생각하는 코드를 올려주세요. 4. 이 강좌를 바탕으로 여러분이 응용을 해보다가 막히는 부분, 여러 개의 선택지 중에서 조언이 필요한 부분, 제 경험이 궁금한 부분에 대한 질문은 대환영입니다. 다만 여러분의 회사 일은 질문하지 마세요. 5. 강좌 하나 끝날 때마다 남의 질문들을 읽어보세요. 여러분이 곧 만나게 될 에러들입니다. 6. 위에 적은 내용을 명심하지 않으시면 백날 강좌를 봐도(제 강좌가 아니더라도) 실력이 늘지 않고 그냥 코딩쇼 관람 및 한컴타자연습을 한 셈이 될 겁니다. 이번에 컴퓨터를 밀고 처음부터 설치를 하려고 보니 노드 설치 방법이 책과는 너무 달라져서요 혹시 이미 반영이되지 않았다면 어떤식으로 해야하는지좀 알려주실수 있을까요?
Vscode 터미널에서 npx eas build --platform android --profile development 명령어를 입력하면 Resolved "development" environment for the build. Learn more No environment variables with visibility "Plain text" and "Sensitive" found for the "development" environment on EAS. ✔ Using remote Android credentials (Expo server) ✔ Using Keystore from configuration: Build Credentials B93ecKpj4X (default) Compressing project files and uploading to EAS Build. Learn more ✖ Compressing project files Failed to upload the project tarball to EAS Build Reason: EPERM: operation not permitted, scandir '/Users/development/.Trash' Error: build command failed. GPT는 Trash를 우회해서 하라는데 우회해도 안되고.. .easignore 파일에 .Trash .DS_Store node_modules .git **/.Trash !./.Trash # 만약 현재 디렉토리에 있다면 포함시킴 를 작성해도 계속 같은 에러가 발생합니다ㅠ.ㅠ 어떻게 해결하면 될까요 ?
기본 템플릿 생성 rafce 적용할 때 파일명 기준으로 객체 변수(NavBar) 생성 되는데 오타 때문에 삭제하고 재생성(Navbar)하면 처음 만들었던 이름 그대로 유지되는 습성이 있는데 삭제 하고 다시 만들때 바로 적용 되도록 환경 설정 따로 하는게 있는지 궁금합니다. Components 및 Page 폴더 파일 대소문자 구분 생성 이유가 따로 있는지 아니면 개인적인 개발 습관인지 답변 부탁드립니다.
30분 30초 패딩 넣었는데 a태그의 클릭가능한 범위가 늘어나나요? 줄어들어야 하는것아닌가요 크기를 키우려면 마진을 넣어야하는 것으로 알고있는데요 ㅠ.ㅠ 또한 강의에서 그 직후에 border를 표시해서 z태그들의 영역이 겹치는것을 말씀하시면서, 그 이유가 인라인 요소이기 때문이라고 말씀하셨는데요, 인라인 요소에 대해 제가 알고있는 것은, 블록요소와 다르게오른쪽으로(?) 쌓일 수 있다는 것만 알고있는데, 이것과 인라인요소가 겹치는 이유가 관련이 있는지, 아니면 제가 모르는 다른 무언가때문인지 어쨌든 인라인요소이기 때문에 겹친다 라는 표현이 이해가 안가네요. 감사합니다.
강의 마지막 부분에서 let 으로 count 선언 후, App.jsx에서 <Register/> 를 두 번 호출하면 같은 변수를 쓰면서 같은 Register 함수를 호출하는 것이라 하셨는데 useRef로 선언해도 같은 Register함수를 호출하는 것 아닌가요 ? useRef를 사용하면 const inputRef 로 선언해도 다른 객체로 인식 하는 건지 ..! 궁금합니다.
tailwind css가 편해보이기는 한데, 화면 코드의 많은 부분을 css 클래스로 차지하고 가독성을 헤치는것 같은데요. 실무에서도 예제처럼 html 요소 인라인으로 하나하나 class를 넣어두나요? 이러면 중복되는 코드도 많고 구조 파악도 어려울 것 같아서요 만약 html 디자이너가 따로 있을때는 tailwindcss를 사용하지 않나요? 디자이너랑 협업할때는 css를 따로 만들어 줄것 같은데, 리액트 실무 환경에서 디자인 부분에 대해서 어떤식으로 협업하는지 궁금합니다.