Skip to content

Instantly share code, notes, and snippets.

@SachaG
Last active June 8, 2017 15:15
Show Gist options
  • Save SachaG/3c49b9ce719c07c151a73e382e2df0fb to your computer and use it in GitHub Desktop.
Save SachaG/3c49b9ce719c07c151a73e382e2df0fb to your computer and use it in GitHub Desktop.
Nova Gists
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