migrate to spacex api
This commit is contained in:
11
.wundergraph/operations/Dragons.graphql
Normal file
11
.wundergraph/operations/Dragons.graphql
Normal file
@ -0,0 +1,11 @@
|
||||
query Dragons {
|
||||
spacex_dragons {
|
||||
name
|
||||
active
|
||||
# remove the comments to add thrusters to the query
|
||||
# thrusters {
|
||||
# amount
|
||||
# pods
|
||||
# }
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
query ($city: String!) {
|
||||
weather_getCityByName(name: $city, config: { units: metric }) {
|
||||
# remove the comments to add the coordinates to the query
|
||||
# coordinates: coord {
|
||||
# lat
|
||||
# lon
|
||||
# }
|
||||
country
|
||||
weather {
|
||||
temperature {
|
||||
actual
|
||||
feelsLike
|
||||
min
|
||||
max
|
||||
}
|
||||
summary {
|
||||
title
|
||||
description
|
||||
icon
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -8,14 +8,14 @@ import {
|
||||
import server from "./wundergraph.server";
|
||||
import operations from "./wundergraph.operations";
|
||||
|
||||
const weather = introspect.graphql({
|
||||
apiNamespace: "weather",
|
||||
url: "https://graphql-weather-api.herokuapp.com/",
|
||||
const spacex = introspect.graphql({
|
||||
apiNamespace: "spacex",
|
||||
url: "https://spacex-api.fly.dev/graphql",
|
||||
});
|
||||
|
||||
// configureWunderGraph emits the configuration
|
||||
configureWunderGraphApplication({
|
||||
apis: [weather],
|
||||
apis: [spacex],
|
||||
server,
|
||||
operations,
|
||||
codeGenerators: [
|
||||
|
@ -5,9 +5,9 @@ import type { InternalClient } from "./generated/wundergraph.internal.client";
|
||||
export default configureWunderGraphServer<HooksConfig, InternalClient>(() => ({
|
||||
hooks: {
|
||||
queries: {
|
||||
Weather: {
|
||||
Dragons: {
|
||||
postResolve: async (hook) => {
|
||||
hook.log.info("postResolve hook for Weather");
|
||||
hook.log.info("postResolve hook for Dragons");
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user