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
λ‘ λλ리면 λ¬Έμ κ° ν΄κ²°λ©λλ€.
@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"
λ₯Ό μν©λλ€.
κ°μ₯ μ μ©ν λκΈ
μκ² μ΅λλ€. λͺ°λμ΅λλ€. λλ λ¨μ§ λ¬Έμλ₯Ό λ°λλ€. λ¬Έμ λ₯Ό μ’ λ£νκ² μ΅λλ€. κ°μ λ¬Έμ μ μ§λ©΄ν λ€λ₯Έ μ¬λλ€μ μν΄ μ΄κ²μ λ¬Έμννλ κ²μ΄ μ’μ΅λλ€. λ§μ μ¬λλ€μ΄
npm install
(λλyarn
) μ΅μ λ²μ μ μ¬μ©νκ³ μλνμ§ μκΈ° λλ¬Έμ λ λ§μ μ¬λλ€μκ² λ°μν©λλ€.