0
graphql 쿼리에 react-apollo를 사용하고 있습니다. 나는 category.에 대해 하나의 객체를 보여주고 싶습니다. 그래서 나는 navigation.state.params.id에서 얻을 수있는 ID 이 필요합니다. 다음과 같은 작업을 수행했지만 "정의되지 않은 속성 건너 뛰기"를 읽을 수 없습니다. 이 문제를 어떻게 해결해야합니까?정의되지 않은 'skip'속성을 읽을 수 없습니다
여기에 내 코드
class CategoryDetail extends React.PureComponent {
render() {
console.log("props in detail", this.props);
return (
<View style={{ flex: 1 }}>
<Text>Category View</Text>
</View>
);
}
}
const CATEGORY_DETAIL_QUERY = gql`
query CATEGORY_DETAIL_QUERY($id: ID!) {
category(id: $id) {
id
name
}
}
`;
export default graphql(CATEGORY_DETAIL_QUERY, {
options: props => {
variables: {
id: props.navigation.state.params.id;
}
},
})(CategoryDetail);
이 오류가 발생하는 파일과 줄은 무엇입니까? – Tvde1
TypeError : 정의되지 않은 'skip'속성을 읽을 수 없습니다. 이 오류는 Apollo (SceneView.js : 32)의 에 있습니다. – Serenity