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

Function Launch

final/client/src/pages/launch.tsx:25–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23interface LaunchProps {}
24
25const Launch: React.FC<LaunchProps> = () => {
26 let { launchId } = useParams();
27 // This ensures we pass a string, even if useParams returns `undefined`
28 launchId ??= '';
29 const { data, loading, error } = useQuery<LaunchDetailsTypes.LaunchDetails, LaunchDetailsTypes.LaunchDetailsVariables>(GET_LAUNCH_DETAILS, { variables: { launchId } });
30
31 if (loading) return <Loading />;
32 if (error) return <p>ERROR: {error.message}</p>;
33 if (!data) return <p>Not found</p>;
34
35 return (
36 <Fragment>
37 <Header image={data.launch && data.launch.mission && data.launch.mission.missionPatch}>{data && data.launch && data.launch.mission && data.launch.mission.name}</Header>
38 <LaunchDetail {...data.launch} />
39 <ActionButton {...data.launch} />
40 </Fragment>
41 );
42};
43
44export default Launch;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected