fragments
-
[Vue] Vue Apollo FragmentsJavaScript/Vue 2021. 2. 11. 13:56
query에 사용될 필드들을 재사용 할 수 있도록 해줌 // user-info.fragment.gql fragment UserInfo on User { firstName lastName age gender } // get-user.query.gql #import './user-info.fragmet.gql' query getUser($userId: Int!) { getUser(userId: $userId) { ...UserInfo friends { ...UserInfo } } }