Last active
August 6, 2019 14:12
-
-
Save hwillson/f9330c52bafd6321e47bf9e39572a3eb to your computer and use it in GitHub Desktop.
React Apollo 3 - Typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { RocketData, RocketVars } from './types'; | |
const GET_ROCKET_INVENTORY = gql` | |
query getRocketInventory($year: Int!) { | |
rocketInventory(year: $year) { | |
id | |
year | |
} | |
} | |
`; | |
export function RocketInventoryList() { | |
const { loading, data } = useQuery<RocketData, RocketVars>( | |
GET_ROCKET_INVENTORY, | |
{ variables: { year: 2019 } } | |
); | |
return (/* ... show data ... */); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment