Skip to content

Commit feed206

Browse files
authored
Merge pull request #1377 from apollographql/mkoneval/add-service-list-header
add header to service list
2 parents f68b7b7 + a752dbe commit feed206

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- `apollo`
66
- Relax graphql version, resolve missing types "Boolean", "String" [#1355](https://github.com/apollographql/apollo-tooling/pull/1355)
7-
- Add `service:list` and tests [#1358](https://github.com/apollographql/apollo-tooling/pull/1358)
7+
- Add `service:list` and tests [#1358](https://github.com/apollographql/apollo-tooling/pull/1358) and header [#1377](https://github.com/apollographql/apollo-tooling/pull/1377)
88
- Update `service:list` test to use a simulated time to prevent relative dates causing snapshot failures [#1374](https://github.com/apollographql/apollo-tooling/pull/1374)
99
- `apollo-codegen-core`
1010
- <First `apollo-codegen-core` related entry goes here>

packages/apollo/src/commands/service/__tests__/__snapshots__/list.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Loading Apollo Project [completed]
1616
Fetching list of services for graph engine [started]
1717
Fetching list of services for graph engine [completed]
1818
19+
name URL last updated
20+
───────── ───────────────────────────── ─────────────────────────
1921
accounts http://localhost:4001/graphql 13 May 2019 (a month ago)
2022
inventory http://localhost:4002/graphql 16 May 2019 (a month ago)
2123
products http://localhost:4003/graphql 16 May 2019 (a month ago)

packages/apollo/src/commands/service/list.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ function formatHumanReadable({
6767
process.env.NODE_ENV === "test" ? new Date("2019-06-13") : undefined
6868
)
6969
)
70+
.sort((s1, s2) =>
71+
s1.name.toUpperCase() > s2.name.toUpperCase() ? 1 : -1
72+
)
7073
.filter(Boolean),
7174
{
7275
columns: [
73-
{ key: "name", label: "Name" },
76+
{ key: "name", label: "name" },
7477
{ key: "url", label: "URL" },
75-
{ key: "updatedAt", label: "Last Updated At" }
78+
{ key: "updatedAt", label: "last updated" }
7679
],
77-
// Override `printHeader` so we don't print a header
78-
printHeader: () => {},
7980
// The default `printLine` will output to the console; we want to capture the output so we can test
8081
// it.
8182
printLine: line => {

0 commit comments

Comments
 (0)