Skip to content

Commit 4bbf278

Browse files
updating wg sdk and index page
1 parent ab82bdb commit 4bbf278

File tree

6 files changed

+17
-26
lines changed

6 files changed

+17
-26
lines changed

.wundergraph/wundergraph.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ const itsApi = introspect.openApi({
1616
kind: "file",
1717
filePath: "./openapi.yaml",
1818
},
19-
//baseURL: "http://localhost:8090/",
2019
});
20+
2121
// configureWunderGraph emits the configuration
2222
configureWunderGraphApplication({
2323
apis: [itsApi],
@@ -35,7 +35,9 @@ configureWunderGraphApplication({
3535
cors: {
3636
...cors.allowAll,
3737
allowedOrigins:
38-
process.env.NODE_ENV === "production" ? ["https://*"] : ["http://*"],
38+
process.env.NODE_ENV === "production"
39+
? ["https://wg-livemap.vercel.app/"]
40+
: ["http://*"],
3941
/**
4042
* Please configure CORS carefully to make sure that your users are protected.
4143
* Allowing all origins is usually the worst possible configuration.

.wundergraph/wundergraph.server.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql';
2-
import { configureWunderGraphServer } from '@wundergraph/sdk/server';
3-
import type { HooksConfig } from './generated/wundergraph.hooks';
4-
import type { InternalClient } from './generated/wundergraph.internal.client';
1+
import { GraphQLObjectType, GraphQLSchema, GraphQLString } from "graphql";
2+
import { configureWunderGraphServer } from "@wundergraph/sdk/server";
3+
import type { HooksConfig } from "./generated/wundergraph.hooks";
4+
import type { InternalClient } from "./generated/wundergraph.internal.client";
55

66
export default configureWunderGraphServer<HooksConfig, InternalClient>(() => ({
7-
hooks: {
8-
queries: {},
9-
mutations: {},
10-
},
11-
graphqlServers: [],
7+
hooks: {
8+
queries: {},
9+
mutations: {},
10+
},
11+
graphqlServers: [],
1212
}));

components/generated/client.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface AuthProvider {
4747
}
4848

4949
export const defaultClientConfig: ClientConfig = {
50-
applicationHash: "c9e5c89c",
50+
applicationHash: "551dfb21",
5151
baseURL: "http://localhost:9991",
5252
sdkVersion: "0.137.4",
5353
};
@@ -119,7 +119,6 @@ export type Queries = {
119119
input?: undefined;
120120
data: LocationResponseData;
121121
requiresAuthentication: false;
122-
liveQuery: boolean;
123122
};
124123
"users/get": {
125124
input: UsersGetInput;
@@ -151,12 +150,6 @@ export type Subscriptions = {
151150
};
152151

153152
export type LiveQueries = {
154-
Location: {
155-
input?: undefined;
156-
data: LocationResponseData;
157-
liveQuery: true;
158-
requiresAuthentication: false;
159-
};
160153
"users/get": {
161154
input: UsersGetInput;
162155
data: UsersGetResponseData;

components/generated/models.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export interface LocationResponseData {
8080
};
8181
directionRef?: string;
8282
operatorRef?: string;
83-
vehicleRef?: string;
8483
lineRef?: string;
8584
};
8685
}[];

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"test:playwright": "npx -- playwright test"
1616
},
1717
"dependencies": {
18-
"@wundergraph/nextjs": "^0.9.4",
19-
"@wundergraph/sdk": "^0.137.4",
18+
"@wundergraph/nextjs": "^0.9.6",
19+
"@wundergraph/sdk": "^0.139.0",
2020
"graphql": "^16.3.0",
2121
"mapbox-gl": "^2.13.0",
2222
"maplibre-gl": "^2.4.0",

pages/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const Home: NextPage = () => {
2020
const locations = useQuery({
2121
operationName: "Location",
2222
liveQuery: true,
23-
revalidateOnFocus: false,
2423
});
2524

2625
return (
@@ -95,7 +94,7 @@ const Home: NextPage = () => {
9594
{locations.data &&
9695
locations.data.getVehicleActivity?.body?.map(
9796
(location, index) => {
98-
const { vehicleLocation, bearing, lineRef } =
97+
const { vehicleLocation, bearing } =
9998
location.monitoredVehicleJourney!;
10099
return (
101100
<Marker
@@ -106,10 +105,8 @@ const Home: NextPage = () => {
106105
>
107106
<Pin
108107
onMouseMove={(e) => {
109-
// e.stopPropagation();
110108
//@ts-ignore
111109
const { layerX: x, layerY: y } = e.nativeEvent;
112-
113110
setPopupInfo(
114111
location && {
115112
feature: location,

0 commit comments

Comments
 (0)