import { Query } from 'react-apollo' import Instrument, { INSTRUMENT_QUERY } from '../components/Instrument' import InstrumentList from '../components/InstrumentList' const InstrumentsPage = props => props.query && props.query.id ? ( {({ data, loading, error }) => { if (loading) return Loading instrument... if (error) return Error loading instrument: {error.message} const { instrument } = data return }} ) : ( ) InstrumentsPage.getInitialProps = ({ query }) => { return { query } } export default InstrumentsPage
Loading instrument...
Error loading instrument: {error.message}