Last active
June 8, 2017 15:15
-
-
Save SachaG/3c49b9ce719c07c151a73e382e2df0fb to your computer and use it in GitHub Desktop.
Nova Gists
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 {withList} from 'meteor/nova:core'; | |
import gql from 'graphql-tag'; | |
import Movies from 'movies.js'; | |
const MyComponent = ({loading, results}) => <div> | |
{ loading ? <p>Loading…</p> : results.map(movie => <p>{movie.title} ({movie.year})</p>) } | |
</div> | |
const options = { | |
collection: Movies, | |
queryName: 'moviesListQuery', | |
fragment: gql` | |
fragment MoviesItemFragment on Movie { | |
_id | |
title | |
year | |
} | |
` | |
} | |
export default withList(options)(MyComponent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment