MCPcopy Create free account
hub / github.com/TanStack/query / getCharacter

Function getCharacter

examples/react/star-wars/src/api.ts:16–19  ·  view source on GitHub ↗
(characterId: string)

Source from the content-addressed store, hash-verified

14}
15
16export const getCharacter = async (characterId: string) => {
17 const res = await fetch(`https://swapi.dev/api/people/${characterId}/`)
18 return await res.json()
19}
20
21export const getPlanet = async (planetId: string) => {
22 const res = await fetch(`https://swapi.dev/api/planets/${planetId}/`)

Callers 2

CharacterFunction · 0.90
CharacterFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected