MCPcopy Create free account
hub / github.com/apollographql/fullstack-tutorial / Profile

Function Profile

final/client/src/pages/profile.tsx:23–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21interface ProfileProps {}
22
23const Profile: React.FC<ProfileProps> = () => {
24 const { data, loading, error } = useQuery<GetMyTripsTypes.GetMyTrips>(GET_MY_TRIPS, { fetchPolicy: 'network-only' });
25 if (loading) return <Loading />;
26 if (error) return <p>ERROR: {error.message}</p>;
27 if (data === undefined) return <p>ERROR</p>;
28
29 return (
30 <Fragment>
31 <Header>My Trips</Header>
32 {data.me && data.me.trips.length ? data.me.trips.map((launch: any) => <LaunchTile key={launch.id} launch={launch} />) : <p>You haven't booked any trips</p>}
33 </Fragment>
34 );
35};
36
37export default Profile;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected