Apollo-link-rest: Veraltet: '@rest (Pfad:' enthält einen Doppelpunkt ':', dieses Format wird in zukünftigen Versionen entfernt

Erstellt am 31. Aug. 2018  ·  2Kommentare  ·  Quelle: apollographql/apollo-link-rest

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
    }
  }
`;

Warnung: Veraltet: '@rest (Pfad:' enthält einen Doppelpunkt ':', dieses Format wird in zukünftigen Versionen entfernt

Was könnte das Problem sein?

[email protected]
[email protected]
[email protected]
[email protected]

question❔

Hilfreichster Kommentar

Sie sollten auf die neue Syntax aktualisieren, um diese Warnung zu entfernen:

 @rest(type: "Person", path: "people/:id") {

wird

 @rest(type: "Person", path: "people/{args.id}") {

Alle 2 Kommentare

Sie sollten auf die neue Syntax aktualisieren, um diese Warnung zu entfernen:

 @rest(type: "Person", path: "people/:id") {

wird

 @rest(type: "Person", path: "people/{args.id}") {

tolle Antwort @dbryand!

War diese Seite hilfreich?
0 / 5 - 0 Bewertungen