const restLink = new RestLink({
uri: 'https://swapi.co/api/',
});
const client = new ApolloClient({
link: restLink,
cache: new InMemoryCache(),
});
const Query = gql`
query luke($id: String!) {
person(id: $id)
@rest(type: "Person", path: "people/:id") {
name
}
}
`;
๊ฒฝ๊ณ : ๋ ์ด์ ์ฌ์ฉ๋์ง ์์ : '@rest (path :'์ ':'์ฝ๋ก ์ด ํฌํจ๋์ด ์์ต๋๋ค.์ด ํ์์ ํฅํ ๋ฒ์ ์์ ์ ๊ฑฐ๋ฉ๋๋ค.
๋ฌด์์ด ๋ฌธ์ ์ผ๊น์?
[email protected]
[email protected]
[email protected]
[email protected]
๊ฒฝ๊ณ ๋ฅผ ์์ ๊ธฐ ์ํด ์ ๊ตฌ๋ฌธ์ผ๋ก ์ ๋ฐ์ดํธํด์ผํฉ๋๋ค.
@rest(type: "Person", path: "people/:id") {
๋๋ค
@rest(type: "Person", path: "people/{args.id}") {
์ข์ ๋๋ต @dbryand!
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๊ฒฝ๊ณ ๋ฅผ ์์ ๊ธฐ ์ํด ์ ๊ตฌ๋ฌธ์ผ๋ก ์ ๋ฐ์ดํธํด์ผํฉ๋๋ค.
๋๋ค