Apollo-link-rest: 'RestLink' μœ ν˜•μ— 'ApolloLink' μœ ν˜•μ—μ„œ λ‹€μŒ 속성이 λˆ„λ½λ˜μ—ˆμŠ΅λ‹ˆλ‹€. split, concat

에 λ§Œλ“  2020λ…„ 06μ›” 14일  Β·  4μ½”λ©˜νŠΈ  Β·  좜처: apollographql/apollo-link-rest


0.8.0-beta.0 λ²„μ „μ—μ„œ RestLink κ΅¬ν˜„μ΄ κΉ¨μ‘ŒμŠ΅λ‹ˆλ‹€. 이 νŠœν† λ¦¬μ–Όμ„ λ”°λžμ§€λ§Œ 첫 번째 μ½”λ“œ 블둝이 이미 κΉ¨μ‘ŒμŠ΅λ‹ˆλ‹€.

// Create a RestLink for the Github API
const link = new RestLink({ uri: 'https://api.github.com' });

// Configure the ApolloClient with the recommended cache and our RestLink
const client = new ApolloClient({
  cache: new InMemoryCache(),
  link,
}); 

λ‹€μŒ TypeScript 였λ₯˜κ°€ λ°œμƒν•©λ‹ˆλ‹€.

Type 'RestLink' is missing the following properties from type 'ApolloLink': split, concat

μ„ΈλΆ€:

{
    "resource": "/*redacted*/src/file.ts",
    "owner": "typescript",
    "code": "2739",
    "severity": 8,
    "message": "Type 'RestLink' is missing the following properties from type 'ApolloLink': split, concat",
    "source": "ts",
    "startLineNumber": 11,
    "startColumn": 3,
    "endLineNumber": 11,
    "endColumn": 7,
    "relatedInformation": [
        {
            "startLineNumber": 17,
            "startColumn": 5,
            "endLineNumber": 17,
            "endColumn": 9,
            "message": "The expected type comes from property 'link' which is declared here on type 'ApolloClientOptions<NormalizedCacheObject>'",
            "resource": "/*redacted*/node_modules/apollo-client/ApolloClient.d.ts"
        }
    ]
}

이 λ™μž‘μ€ apollo-link-rest 쒅속성을 0.8.0-beta.0 둜 μ—…κ·Έλ ˆμ΄λ“œν•˜μ—¬ μ½”λ“œμƒŒλ“œλ°•μŠ€ μ˜ˆμ œμ—μ„œ μž¬ν˜„ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

v0.7.3 둜 되돌리면 λ¬Έμ œκ°€ ν•΄κ²°λ©λ‹ˆλ‹€.

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

μ•Œκ² μŠ΅λ‹ˆλ‹€. λͺ°λžμŠ΅λ‹ˆλ‹€. λ‚˜λŠ” 단지 λ¬Έμ„œλ₯Ό λ”°λžλ‹€. 문제λ₯Ό μ’…λ£Œν•˜κ² μŠ΅λ‹ˆλ‹€. 같은 λ¬Έμ œμ— μ§λ©΄ν•œ λ‹€λ₯Έ μ‚¬λžŒλ“€μ„ μœ„ν•΄ 이것을 λ¬Έμ„œν™”ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€. λ§Žμ€ μ‚¬λžŒλ“€μ΄ npm install (λ˜λŠ” yarn ) μ΅œμ‹  버전을 μ‚¬μš©ν•˜κ³  μž‘λ™ν•˜μ§€ μ•ŠκΈ° λ•Œλ¬Έμ— 더 λ§Žμ€ μ‚¬λžŒλ“€μ—κ²Œ λ°œμƒν•©λ‹ˆλ‹€.

λͺ¨λ“  4 λŒ“κΈ€

@lextas μ—κ²Œ κ°μ‚¬λ“œλ¦½λ‹ˆλ‹€. λ² νƒ€λŠ” Apollo-client 3.0(및 ν˜Έν™˜ κ°€λŠ₯ν•œ λ²„μ „μ˜ κ΄€λ ¨ Apollo νŒ¨ν‚€μ§€)μ—μ„œλ§Œ μ‚¬μš©ν•˜κΈ° μœ„ν•œ κ²ƒμž…λ‹ˆλ‹€.

λΆˆν–‰νžˆλ„ 세계 μ‚¬κ±΄μœΌλ‘œ 인해 Apollo-client 3.0이 μ§€μ—°λ˜μ—ˆμœΌλ©° ν˜„μž¬ μ–Έμ œ 배솑할 κ³„νšμΈμ§€ λͺ¨λ¦…λ‹ˆλ‹€.

μ•Œκ² μŠ΅λ‹ˆλ‹€. λͺ°λžμŠ΅λ‹ˆλ‹€. λ‚˜λŠ” 단지 λ¬Έμ„œλ₯Ό λ”°λžλ‹€. 문제λ₯Ό μ’…λ£Œν•˜κ² μŠ΅λ‹ˆλ‹€. 같은 λ¬Έμ œμ— μ§λ©΄ν•œ λ‹€λ₯Έ μ‚¬λžŒλ“€μ„ μœ„ν•΄ 이것을 λ¬Έμ„œν™”ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€. λ§Žμ€ μ‚¬λžŒλ“€μ΄ npm install (λ˜λŠ” yarn ) μ΅œμ‹  버전을 μ‚¬μš©ν•˜κ³  μž‘λ™ν•˜μ§€ μ•ŠκΈ° λ•Œλ¬Έμ— 더 λ§Žμ€ μ‚¬λžŒλ“€μ—κ²Œ λ°œμƒν•©λ‹ˆλ‹€.

흠 그럼 μ–΄λ–€ 버전을 μ‚¬μš©ν•΄μ•Ό ν• κΉŒμš”? 방금 이에 λŒ€ν•œ μ„€μ • κ°€μ΄λ“œλ₯Ό λ”°λžκ³  이 λ¬Έμ œκ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€.

    "apollo-cache-inmemory": "^1.6.6",
    "apollo-client": "^2.6.10",
    "apollo-link": "^1.2.14",
    "apollo-link-rest": "^0.8.0-beta.0",

@Andrew1431 -- λ‹€λ₯Έ νŒ¨ν‚€μ§€μ˜ ν•΄λ‹Ή λ²„μ „μ—μ„œλŠ” "apollo-link-rest": "^0.7.0" λ₯Ό μ›ν•©λ‹ˆλ‹€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰