Skip to content
This repository was archived by the owner on Apr 14, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions docs/source/tutorial/queries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ const Launches: React.FC<LaunchesProps> = () => {
return (
<Fragment>
<Header />
{data.launches &&
data.launches.launches &&
data.launches.launches.map((launch: any) => (
{data?.launches?.launches?.map((launch: any) => (
<LaunchTile key={launch.id} launch={launch} />
))}
</Fragment>
Expand Down Expand Up @@ -137,8 +135,7 @@ Copy the code below and add it before the closing `</Fragment>` tag in the `Laun
<MultiCodeBlock>

```tsx:title=src/pages/launches.tsx
{data.launches &&
data.launches.hasMore && (
{data?.launches?.hasMore && (
<Button
onClick={() =>
fetchMore({ // highlight-line
Expand Down Expand Up @@ -168,8 +165,7 @@ Copy the code below and add it before the closing `</Fragment>` tag in the `Laun
```

```jsx:title=src/pages/launches.jsx
{data.launches &&
data.launches.hasMore && (
{data?.launches?.hasMore && (
<Button
onClick={() =>
fetchMore({ // highlight-line
Expand Down Expand Up @@ -271,11 +267,11 @@ const Launch: React.FC<LaunchProps> = ({ launchId }) => {

return (
<Fragment>
<Header image={data.launch && data.launch.mission && data.launch.mission.missionPatch}>
{data && data.launch && data.launch.mission && data.launch.mission.name}
<Header image={data?.launch?.mission?.missionPatch}>
{data?.launch?.mission?.name}
</Header>
<LaunchDetail {...data.launch} />
<ActionButton {...data.launch} />
<LaunchDetail {...data?.launch} />
<ActionButton {...data?.launch} />
</Fragment>
);
}
Expand Down Expand Up @@ -415,7 +411,7 @@ const Profile: React.FC<ProfileProps> = () => {
return (
<Fragment>
<Header>My Trips</Header>
{data.me && data.me.trips.length ? (
{data?.me?.trips?.length > 0 ? (
data.me.trips.map((launch: any) => (
<LaunchTile key={launch.id} launch={launch} />
))
Expand Down