Skip to content

Commit

Permalink
Export server/router (#84)
Browse files Browse the repository at this point in the history
- Export `createRouter` by exporting the HTTP handler so we can use
`fetch` function from it inside tests without starting a real server
- Export `close` method in the return value of `serve` so we can use
start and stop server
- Avoid top-level await for better support in most envs
- In case of `npm install` from another project, it runs `tsc` to
generate js and declaration files to be used in our Hive GW test suite
here;
graphql-hive/gateway#120

---------

Co-authored-by: Kamil Kisiela <kamil.kisiela@gmail.com>
  • Loading branch information
ardatan and kamilkisiela authored Nov 18, 2024
1 parent 296ae0f commit d214e4a
Show file tree
Hide file tree
Showing 10 changed files with 230 additions and 269 deletions.
102 changes: 20 additions & 82 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@
"summary": "tsx ./src/summary.ts",
"build": "tsc",
"typecheck": "tsc --noEmit",
"format": "prettier --write ."
"format": "prettier --write .",
"postinstall": "npx tsc --project tsconfig.json --noCheck --noResolve"
},
"dependencies": {
"@apollo/composition": "2.9.3",
"@apollo/subgraph": "2.9.3",
"async-retry": "1.3.3",
"dotenv": "16.4.5",
"fets": "0.8.3",
"fets": "0.8.4",
"get-port": "7.1.0",
"graphql": "16.9.0",
"graphql-yoga": "5.10.2",
Expand All @@ -77,7 +78,7 @@
"express": "5.0.1",
"prettier": "3.3.3",
"tsx": "4.19.2",
"typescript": "5.6.3",
"wgc": "0.70.1"
"wgc": "0.70.1",
"typescript": "5.6.3"
}
}
}
Loading

0 comments on commit d214e4a

Please sign in to comment.