Skip to content

Commit

Permalink
update dependencies and examples (#319)
Browse files Browse the repository at this point in the history
* update dependencies and examples
  • Loading branch information
Diizzayy committed Mar 12, 2023
1 parent f865e59 commit 69c6974
Show file tree
Hide file tree
Showing 16 changed files with 3,343 additions and 2,205 deletions.
18 changes: 9 additions & 9 deletions examples/basic/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@
<p>Launch Count: {{ data?.launches.length || 0 }}</p>

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

<div v-else>
<div class="thumbnail">
<img
src="https://placehold.co/150"
:alt="entry.mission_name"
:alt="entry.name || `Launch ${i}`"
/>
</div>
</div>

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

<p>
<p v-if="entry.links?.article">
More info:
<a :href="entry.links.article_link" target="_blank">Read Article</a>
<a :href="entry.links?.article" target="_blank">Read Article</a>
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default defineNuxtConfig({

runtimeConfig: {
public: {
GQL_HOST: 'https://spacex-api-2gl6xp7kua-ue.a.run.app/graphql'
GQL_HOST: 'https://spacex-api-2gl6xp7kua-ue.a.run.app/query'
}
}
})
3 changes: 1 addition & 2 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"dev": "nuxt dev",
"build": "nuxt build",
"preview": "nuxt preview",
"generate": "nuxt generate",
"postinstall": "nuxt prepare"
"generate": "nuxt generate"
},
"devDependencies": {
"@nuxt/ui": "latest",
Expand Down
20 changes: 11 additions & 9 deletions examples/basic/queries/launches.gql
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
query launches($sort: String = "launch_year", $order: String = "desc", $limit: Int = 10) {
launches(sort: $sort, order: $order, find: { mission_name: "Starlink" }, limit: $limit) {
query launches($sort: String = "date", $order: SortOrder = desc, $limit: Int = 10) {
launches(sort: $sort, order: $order, filter: { name: "Starlink" }, limit: $limit) {
id
details
mission_name
launch_year
launch_success
name
date
success
links {
article_link
flickr_images
article
patch {
small
}
}
rocket {
rocket_name
rocket_type
name
type
}
}
}
3 changes: 1 addition & 2 deletions examples/extends/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"dev": "nuxt dev",
"build": "nuxt build",
"preview": "nuxt preview",
"generate": "nuxt generate",
"postinstall": "nuxt prepare"
"generate": "nuxt generate"
},
"devDependencies": {
"@nuxt/ui": "latest",
Expand Down
2 changes: 1 addition & 1 deletion examples/multi-client/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineNuxtConfig({
codegen: false,
clients: {
spacex: {
host: 'https://spacex-api-2gl6xp7kua-ue.a.run.app/graphql',
host: 'https://spacex-api-2gl6xp7kua-ue.a.run.app/query',
headers: {
serverOnly: {
'X-SERVER-ONLY': 'vcvxcvx'
Expand Down
3 changes: 1 addition & 2 deletions examples/multi-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"dev": "nuxt dev",
"build": "nuxt build",
"preview": "nuxt preview",
"generate": "nuxt generate",
"postinstall": "nuxt prepare"
"generate": "nuxt generate"
},
"devDependencies": {
"@nuxt/ui": "latest",
Expand Down
9 changes: 9 additions & 0 deletions examples/multi-client/pages/spacex/crew.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template>
<p>Crew Name: {{ data?.crew?.name || 'Unknown' }}</p>
</template>

<script lang="ts" setup>
const GqlInstance = useGql()

const { data } = await useAsyncData(() => GqlInstance('crew'))
</script>
9 changes: 0 additions & 9 deletions examples/multi-client/pages/spacex/mission.vue

This file was deleted.

5 changes: 5 additions & 0 deletions examples/multi-client/queries/spacex/crew.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
query crew {
crew (filter: { name: "Douglas Hurley" }) {
name
}
}
5 changes: 0 additions & 5 deletions examples/multi-client/queries/spacex/mission.gql

This file was deleted.

3 changes: 1 addition & 2 deletions examples/starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"dev": "nuxt dev",
"build": "nuxt build",
"preview": "nuxt preview",
"generate": "nuxt generate",
"postinstall": "nuxt prepare"
"generate": "nuxt generate"
},
"devDependencies": {
"@nuxt/ui": "latest",
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@
"example:build": "./scripts/example.sh build",
"dev": "nuxi dev playground",
"dev:build": "nuxi build playground",
"test": "vitest run",
"test": "nuxi prepare examples/basic && nuxi prepare examples/multi-client && vitest run",
"lint": "eslint --ext .js,.ts,.vue .",
"lint:fix": "eslint --fix --ext .js,.ts,.vue .",
"prepare": "nuxt-module-build --stub && nuxi prepare playground"
},
"dependencies": {
"@graphql-codegen/cli": "npm:graphql-codegen-cli-nuxt@latest",
"@graphql-codegen/typescript": "^2.8.3",
"@graphql-codegen/cli": "^3.2.1",
"@graphql-codegen/typescript": "^3.0.1",
"@graphql-codegen/typescript-graphql-request": "^4.5.8",
"@graphql-codegen/typescript-operations": "^2.5.8",
"@graphql-codegen/typescript-operations": "^3.0.1",
"@nuxt/kit": "latest",
"defu": "^6.1.1",
"defu": "^6.1.2",
"graphql": "^16.6.0",
"graphql-request": "^5.0.0",
"graphql-request": "5.0.0",
"knitwork": "^1.0.0",
"ohash": "^1.0.0",
"scule": "^1.0.0"
Expand All @@ -61,10 +61,10 @@
"@nuxt/module-builder": "latest",
"@nuxt/test-utils": "latest",
"@nuxtjs/eslint-config-typescript": "latest",
"@vitest/coverage-c8": "^0.25.3",
"eslint": "^8.29.0",
"@vitest/coverage-c8": "^0.29.2",
"eslint": "^8.35.0",
"nuxt": "latest",
"vitest": "^0.25.3"
"vitest": "^0.29.2"
},
"packageManager": "pnpm@7.18.0"
"packageManager": "pnpm@7.29.1"
}
2 changes: 1 addition & 1 deletion playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default defineNuxtConfig({

runtimeConfig: {
public: {
GQL_HOST: 'https://spacex-api-2gl6xp7kua-ue.a.run.app/graphql'
GQL_HOST: 'https://spacex-api-2gl6xp7kua-ue.a.run.app/query'
}
}
})
Loading

0 comments on commit 69c6974

Please sign in to comment.