[Recordocs] 20190716
1 min readJul 16, 2019
- graphQL — skip
Apollo Docs를 보면 skip: boolean If skip is true, the query will be skipped entirely. 이라고 나와있다. skip 은 boolean 값이며 해당 값이 true 이면 query 값이 skip 되는 것이다.
예를들어
const term = search.split("=")[1];
const { data, loading } = useQuery(SEARCH, {
skip: term === undefined,
variables: {
term
}
});
이라는 코드를 통해 term 이 undefined 일 경우 해당 query(SEARCH) 의 값이 skip 되는 것이다.