전체 글

전체 글

    day05 - 과제 수행

    실패한 나의 코드 // 커피 목록 조회 API를 요청해주세요. let result; const getCoffee = () => { console.log("index.js 파일의 openMenu 함수 안에서 getCoffee가 실행 됨"); // 1. 백엔드 서버로 /starbucks API 요청해 커피 데이터를 받는다. axios.get("http://localhost:3000/starbucks").then((res) => { console.log(res); console.log(res.data); result = res.data; console.log(result[0]); }); // 2. 받은 데이터로 createMenuCard 함수를 이용해 메뉴 카드를 모두 만들어주세요. for (let i = 0..

    고농축 백엔드 5 - graphql 연습2

    1) createBoard를 활용해, 게시물을 하나 등록해 주세요. 등록 mutation{ createBoard(createBoardInput:{writer: "세종대왕", password: "1", title: "한글", contents: "나랐말쌈이 중국과 달라"}){ _id title contents likeCount dislikeCount createdAt updatedAt } } 결과 { "data": { "createBoard": { "_id": "63c7ecb47d035600293d9a61", "title": "한글", "contents": "나랐말쌈이 중국과 달라", "likeCount": 0, "dislikeCount": 0, "createdAt": "2023-01-18T12:57:24...

    고농축 백엔드4 -GraphQL 2

    type Return { _id:String number: Int message: String } 3개 중에서 반드시 1개 이상은 받아야 한다. 또한 리턴타입이 { } 객체이기 때문에 중괄호를 해주어야 한다. !가 붙어있는 경우 필수값이므로 반드시 입력 fetchBoardsCount: Int 위와 같은 경우 query { fetchBoardsCount } fetchProfilesCount: Int 위와 같은 경우 query { fetchProfilesCount } likeBoard(boardId: ID!): Int! 위와 같은 경우 mutation{ likeBoard(boardId : "63c7ecb47d035600293d9a61") } fetchBoards( endDate: DateTime startD..

    고농축 백엔드 3 - GraphQL★★

    GraphQL 스키마에서는 조회 가능한 데이터의 유형과 그 조회문에서 사용 가능한 필드를 정의하고, 리졸버에서는 필드가 조회될 때 호출되는 함수를 정의합니다. Schema : graphql의 구조를 정의 Query : 데이터 조회 Mutation: 등록, 수정, 삭제 localhost:3000/graphql query { humans { humanName blood gender age phone hobbies { hobbyName } } } 사람과 게시물을 동시에 조회 query { humans { humanName blood gender age phone hobbies { hobbyName } } posts { title userId category { name } } } 아래와 같은 경우 skp, l..