From 8e6bd945107772dbe97fe7b494d620afd83edb7e Mon Sep 17 00:00:00 2001 From: Nithin Kumar B Date: Thu, 3 Nov 2022 14:24:01 +0530 Subject: [PATCH] fix formatting --- .wundergraph/operations/Weather.graphql | 40 ++++++------- .wundergraph/wundergraph.config.ts | 79 +++++++++++++------------ .wundergraph/wundergraph.operations.ts | 58 +++++++++--------- 3 files changed, 89 insertions(+), 88 deletions(-) diff --git a/.wundergraph/operations/Weather.graphql b/.wundergraph/operations/Weather.graphql index 38cf02a..7e77faf 100644 --- a/.wundergraph/operations/Weather.graphql +++ b/.wundergraph/operations/Weather.graphql @@ -1,23 +1,23 @@ 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 - } - } + 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 + } } + } } diff --git a/.wundergraph/wundergraph.config.ts b/.wundergraph/wundergraph.config.ts index b07fc26..17f6f21 100755 --- a/.wundergraph/wundergraph.config.ts +++ b/.wundergraph/wundergraph.config.ts @@ -1,51 +1,52 @@ import { - Application, - configureWunderGraphApplication, - cors, - EnvironmentVariable, - introspect, - templates, -} from '@wundergraph/sdk'; -import server from './wundergraph.server'; -import operations from './wundergraph.operations'; + Application, + configureWunderGraphApplication, + cors, + EnvironmentVariable, + introspect, + templates, +} from "@wundergraph/sdk"; +import server from "./wundergraph.server"; +import operations from "./wundergraph.operations"; const weather = introspect.graphql({ - apiNamespace: 'weather', - url: 'https://graphql-weather-api.herokuapp.com/', + apiNamespace: "weather", + url: "https://graphql-weather-api.herokuapp.com/", }); const myApplication = new Application({ - name: 'app', - apis: [ - weather, - ], + name: "app", + apis: [weather], }); // configureWunderGraph emits the configuration configureWunderGraphApplication({ - application: myApplication, - server, - operations, - codeGenerators: [ - { - templates: [ - ...templates.typescript.all, - templates.typescript.operations, - templates.typescript.linkBuilder, - ], - }, - ], - cors: { - ...cors.allowAll, - allowedOrigins: - process.env.NODE_ENV === 'production' - ? [ - // change this before deploying to production to the actual domain where you're deploying your app - 'http://localhost:3000', - ] - : ['http://localhost:3000', new EnvironmentVariable('WG_ALLOWED_ORIGIN')], - }, - dotGraphQLConfig: { - hasDotWunderGraphDirectory: false, + application: myApplication, + server, + operations, + codeGenerators: [ + { + templates: [ + ...templates.typescript.all, + templates.typescript.operations, + templates.typescript.linkBuilder, + ], }, + ], + cors: { + ...cors.allowAll, + allowedOrigins: + process.env.NODE_ENV === "production" + ? [ + // change this before deploying to production to the actual domain where you're deploying your app + "http://localhost:3000", + ] + : [ + "http://localhost:3000", + new EnvironmentVariable("WG_ALLOWED_ORIGIN"), + ], + }, + dotGraphQLConfig: { + hasDotWunderGraphDirectory: false, + }, }); diff --git a/.wundergraph/wundergraph.operations.ts b/.wundergraph/wundergraph.operations.ts index 47ccae4..19eaa1e 100755 --- a/.wundergraph/wundergraph.operations.ts +++ b/.wundergraph/wundergraph.operations.ts @@ -1,32 +1,32 @@ -import { configureWunderGraphOperations } from '@wundergraph/sdk'; -import type { OperationsConfiguration } from './generated/wundergraph.operations'; +import { configureWunderGraphOperations } from "@wundergraph/sdk"; +import type { OperationsConfiguration } from "./generated/wundergraph.operations"; export default configureWunderGraphOperations({ - operations: { - defaultConfig: { - authentication: { - required: false, - }, - }, - queries: (config) => ({ - ...config, - caching: { - enable: false, - staleWhileRevalidate: 60, - maxAge: 60, - public: true, - }, - liveQuery: { - enable: true, - pollingIntervalSeconds: 1, - }, - }), - mutations: (config) => ({ - ...config, - }), - subscriptions: (config) => ({ - ...config, - }), - custom: {}, - }, + operations: { + defaultConfig: { + authentication: { + required: false, + }, + }, + queries: (config) => ({ + ...config, + caching: { + enable: false, + staleWhileRevalidate: 60, + maxAge: 60, + public: true, + }, + liveQuery: { + enable: true, + pollingIntervalSeconds: 1, + }, + }), + mutations: (config) => ({ + ...config, + }), + subscriptions: (config) => ({ + ...config, + }), + custom: {}, + }, });