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!
最も参考になるコメント
その警告を取り除くために、新しい構文に更新する必要があります。
になります