Skip to content

Commit

Permalink
Updates to components
Browse files Browse the repository at this point in the history
  • Loading branch information
ccabo1 committed Sep 8, 2018
1 parent 8f05ec2 commit ff72dbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React, { Component } from 'react';
import ApolloClient from 'apollo-boost';
import { ApolloProvider } from 'react-apollo';

import Workshops from './components/Workshops';

import './App.css';

const client = new ApolloClient({
Expand All @@ -17,6 +19,7 @@ const App = () => (
<p className="App-intro">
This should be fun!
</p>
<Workshops />
</div>
</ApolloProvider>
);
Expand Down
8 changes: 5 additions & 3 deletions src/components/Workshops.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import gql from 'graphql-tag';

const Workshops = () => (
<Query query={gql`
workshops {
title
{
workshops {
title
}
}
`}>
{({ loading, error, data }) => {
if (loading) return (<p>Loading...</p>);
if (error) return (<p>There was an error :(</p>);
return (<p>{data.workshops[0].title}</p>)
return (<p>We have some data! 🧚‍🐄🍻</p>)
}}
</Query>
);
Expand Down

0 comments on commit ff72dbc

Please sign in to comment.