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
}
}
`;
Warning: Deprecated: '@rest(path:' contains a ':' colon, this format will be removed in future versions
What could be the problem?
[email protected]
[email protected]
[email protected]
[email protected]
You'll want to update to the new syntax to get rid of that warning:
@rest(type: "Person", path: "people/:id") {
becomes
@rest(type: "Person", path: "people/{args.id}") {
great answer @dbryand!
Most helpful comment
You'll want to update to the new syntax to get rid of that warning:
becomes