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!
最有用的评论
您将需要更新到新语法来消除该警告:
变成