Last active
December 7, 2016 12:27
-
-
Save rricard/f84d20827528e8687ff62a4ca398471c to your computer and use it in GitHub Desktop.
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 { | |
HeroNameQueryVariables, | |
HeroNameQuery, | |
} from './schema'; | |
// ... | |
const variables: HeroNameQueryVariables = { | |
episode: 'JARJAR', | |
}; | |
// [ts] Type '{ episode: "JARJAR"; }' is not assignable to type 'HeroNameQueryVariables'. | |
// Types of property 'episode' are incompatible. | |
// Type '"JARJAR"' is not assignable to type 'Episode'. | |
client.query({ | |
query: graphqlDocuments['DescribeHero.graphql'], | |
variables, | |
}) | |
.then(({data}: {data: HeroNameQuery}) => { | |
data.hero.friends.forEach(friend => console.log(friend.name)); | |
// [ts] Property 'friends' does not exist on type 'DescribeHeroFragment'. | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment