Skip to content

Commit

Permalink
fix(build): fix ts infer type error
Browse files Browse the repository at this point in the history
  • Loading branch information
adeyahya committed Apr 13, 2021
1 parent b1b3800 commit ff1ec3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/graphql-mesh/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { getMesh } from '@graphql-mesh/runtime';
import { logger } from '../libs';
import { YamlConfig } from '@graphql-mesh/types';

export async function serveMesh(config: YamlConfig.Config, app: Router) {
export default async (config: YamlConfig.Config, app: Router) => {
let readyFlag = false;

const meshConfig = await parseConfig(config);
Expand Down Expand Up @@ -129,4 +129,4 @@ export async function serveMesh(config: YamlConfig.Config, app: Router) {
}));
}
return null;
}
};
4 changes: 2 additions & 2 deletions src/middleware/graphql.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Router } from 'express';
import { serveMesh } from '../graphql-mesh/serve';
import serveGraphql from '../graphql-mesh/serve';
import { Config } from '../types';

export const graphqlMiddleware = (config: Config) => {
const router = Router();

if (config?.graphql) {
serveMesh(config?.graphql, router);
serveGraphql(config?.graphql, router);
} else {
router.use((_, res) => {
res.status(404).json({
Expand Down

0 comments on commit ff1ec3d

Please sign in to comment.