Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated: '@rest(path:' contains a ':' colon, this format will be removed in future versions #141

Closed
oh-klahoma opened this issue Aug 31, 2018 · 2 comments

Comments

@oh-klahoma
Copy link

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?

apollo-link-rest@0.4.4
graphql-tag@2.9.2
graphql@0.13.2
graphql-anywhere@4.1.16

@dbryand
Copy link

dbryand commented Sep 6, 2018

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}") {

@fbartho
Copy link
Collaborator

fbartho commented Sep 16, 2018

great answer @dbryand!

@fbartho fbartho closed this as completed Sep 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants