import gql from 'graphql-tag' import { Query } from 'react-apollo' import Link from 'next/link' const INSTRUMENTS = gql` query INSTRUMENTS { instruments { id name description } } ` const InstrumentList = props => ( {({ data, loading, error }) => { const content = [

Instrument List

] if (loading) content.push(

Loading instruments...

) if (error) content.push(

Error loading instruments: {error.message}

) if (data.instruments.length > 0) { content.push( ) } else { content.push(

No instruments found.

) } return content }}
) export default InstrumentList