_app.js ์์ฑ ์ดํ๋ก ์๋ฌ๊ฐ ๋ฐ์ํ๋ค์
ApolloProvider๊ฐ ๋ด๋ถ์ ์ผ๋ก ์ ๋๋ก ์ค๋น๋์ง ๋ชปํ๊ณ , ๋ฆฌ์กํธ๊ฐ undefined ์ปดํฌ๋ํธ๋ฅผ ๋ ๋ํ๋ ค๋ค Element type is invalid๊ฐ ํฐ์ง ๊ฑฐ ๊ฐ์์. Apollo v3.7 ์ดํ๋ uri๋ง ๋ฃ์ด๋ ๋ด๋ถ์์ ์๋์ผ๋ก HttpLink๋ฅผ ๋ง๋ค์ด์คฌ๋๋ฐ v3.8+๋ถํฐ๋ ์๋ ์์ฑ์ด ๋น ์ ธ์ link๋ฅผ ๋ช
์ํด์ค์ผ ํ๋ค๊ณ ํ๋ค์ ใ
import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client"; import { ApolloProvider } from "@apollo/client/react"; const client = new ApolloClient({ link: new HttpLink({ uri: "https://backend-example.codebootcamp.co.kr/graphql", }), cache: new InMemoryCache(), });์ด๋ ๊ฒ ํ๋๊น ์ ์๋ํ๋๊ฑฐ ๊ฐ์ต๋๋ค.