Skip to content

Instantly share code, notes, and snippets.

@treyhuffine
Created April 20, 2019 22:05
Show Gist options
  • Save treyhuffine/42ee041826f7520ef4ecffdaa4fd40e0 to your computer and use it in GitHub Desktop.
Save treyhuffine/42ee041826f7520ef4ecffdaa4fd40e0 to your computer and use it in GitHub Desktop.
import * as React from 'react';
import { useLaunchProfileQuery } from '../../generated/graphql';
import LaunchProfile from './LaunchProfile';
const LaunchProfileContainer = () => {
const { data, error, loading } = useLaunchProfileQuery({ variables: { id: '42' } });
if (loading) {
return <div>Loading...</div>;
}
if (error) {
return <div>ERROR</div>;
}
if (!data) {
return <div>Select a flight from the panel</div>;
}
return <LaunchProfile data={data} />;
};
export default LaunchProfileContainer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment