Skip to content

Commit fabcb44

Browse files
committed
Fix two issues in remodelled GraphQL API
Network interfaces was never returning anything, due to a dumb bug, and listening with use() instead of post('/') meant that any incorrect paths got a GraphQL error response instead of a proper 404.
1 parent e082493 commit fabcb44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/api/graphql-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const buildResolvers = (apiModel: ApiModel) => {
8080
'certificateContent',
8181
'certificateFingerprint'
8282
]),
83-
networkInterfaces: apiModel.getNetworkInterfaces(),
83+
networkInterfaces: () => apiModel.getNetworkInterfaces(),
8484
systemProxy: async (__: unknown, ___: unknown, context: any) =>
8585
(await getConfig(context)).systemProxy,
8686
dnsServers: async (__: void, { proxyPort }: { proxyPort: number }): Promise<string[]> =>
@@ -170,7 +170,7 @@ export function exposeGraphQLAPI(
170170
resolvers: buildResolvers(apiModel)
171171
});
172172

173-
server.use(graphqlHTTP({
173+
server.post('/', graphqlHTTP({
174174
schema,
175175
graphiql: false
176176
}));

0 commit comments

Comments
 (0)