Skip to content

Commit 69c6974

Browse files
authored
update dependencies and examples (#319)
* update dependencies and examples
1 parent f865e59 commit 69c6974

File tree

16 files changed

+3343
-2205
lines changed

16 files changed

+3343
-2205
lines changed

examples/basic/app.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@
1010
<p>Launch Count: {{ data?.launches.length || 0 }}</p>
1111

1212
<div v-if="!pending" class="launches mt-4">
13-
<div v-for="entry in data?.launches" :key="entry.id">
14-
<div v-if="entry?.links.flickr_images[0]" class="thumbnail">
13+
<div v-for="(entry, i) in data?.launches" :key="entry.id">
14+
<div v-if="entry?.links?.patch?.small" class="thumbnail">
1515
<img
1616
class="lazyload"
1717
src="https://placehold.co/150"
18-
:data-src="entry?.links.flickr_images[0]"
19-
:alt="entry.mission_name"
18+
:data-src="entry?.links.patch?.small"
19+
:alt="entry.name || `Launch ${i}`"
2020
/>
2121
</div>
2222

2323
<div v-else>
2424
<div class="thumbnail">
2525
<img
2626
src="https://placehold.co/150"
27-
:alt="entry.mission_name"
27+
:alt="entry.name || `Launch ${i}`"
2828
/>
2929
</div>
3030
</div>
3131

32-
<h2>{{ `${entry.mission_name} (${entry.launch_year})` }}</h2>
33-
<p>Launch Status: {{ entry.launch_success ? '🚀' : '🪂' }}</p>
32+
<h2>{{ `${entry.name} (${new Date(entry.date).getFullYear()})` }}</h2>
33+
<p>Launch Status: {{ entry.success ? '🚀' : '🪂' }}</p>
3434

35-
<p>
35+
<p v-if="entry.links?.article">
3636
More info:
37-
<a :href="entry.links.article_link" target="_blank">Read Article</a>
37+
<a :href="entry.links?.article" target="_blank">Read Article</a>
3838
</p>
3939
</div>
4040
</div>

examples/basic/nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export default defineNuxtConfig({
33

44
runtimeConfig: {
55
public: {
6-
GQL_HOST: 'https://spacex-api-2gl6xp7kua-ue.a.run.app/graphql'
6+
GQL_HOST: 'https://spacex-api-2gl6xp7kua-ue.a.run.app/query'
77
}
88
}
99
})

examples/basic/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"dev": "nuxt dev",
66
"build": "nuxt build",
77
"preview": "nuxt preview",
8-
"generate": "nuxt generate",
9-
"postinstall": "nuxt prepare"
8+
"generate": "nuxt generate"
109
},
1110
"devDependencies": {
1211
"@nuxt/ui": "latest",
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
query launches($sort: String = "launch_year", $order: String = "desc", $limit: Int = 10) {
2-
launches(sort: $sort, order: $order, find: { mission_name: "Starlink" }, limit: $limit) {
1+
query launches($sort: String = "date", $order: SortOrder = desc, $limit: Int = 10) {
2+
launches(sort: $sort, order: $order, filter: { name: "Starlink" }, limit: $limit) {
33
id
44
details
5-
mission_name
6-
launch_year
7-
launch_success
5+
name
6+
date
7+
success
88
links {
9-
article_link
10-
flickr_images
9+
article
10+
patch {
11+
small
12+
}
1113
}
1214
rocket {
13-
rocket_name
14-
rocket_type
15+
name
16+
type
1517
}
1618
}
1719
}

examples/extends/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"dev": "nuxt dev",
66
"build": "nuxt build",
77
"preview": "nuxt preview",
8-
"generate": "nuxt generate",
9-
"postinstall": "nuxt prepare"
8+
"generate": "nuxt generate"
109
},
1110
"devDependencies": {
1211
"@nuxt/ui": "latest",

examples/multi-client/nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default defineNuxtConfig({
77
codegen: false,
88
clients: {
99
spacex: {
10-
host: 'https://spacex-api-2gl6xp7kua-ue.a.run.app/graphql',
10+
host: 'https://spacex-api-2gl6xp7kua-ue.a.run.app/query',
1111
headers: {
1212
serverOnly: {
1313
'X-SERVER-ONLY': 'vcvxcvx'

examples/multi-client/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"dev": "nuxt dev",
66
"build": "nuxt build",
77
"preview": "nuxt preview",
8-
"generate": "nuxt generate",
9-
"postinstall": "nuxt prepare"
8+
"generate": "nuxt generate"
109
},
1110
"devDependencies": {
1211
"@nuxt/ui": "latest",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template>
2+
<p>Crew Name: {{ data?.crew?.name || 'Unknown' }}</p>
3+
</template>
4+
5+
<script lang="ts" setup>
6+
const GqlInstance = useGql()
7+
8+
const { data } = await useAsyncData(() => GqlInstance('crew'))
9+
</script>

examples/multi-client/pages/spacex/mission.vue

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
query crew {
2+
crew (filter: { name: "Douglas Hurley" }) {
3+
name
4+
}
5+
}

0 commit comments

Comments
 (0)