Skip to content

Commit 0d090a0

Browse files
committed
feat: group expansion globals with comments
1 parent 033b6a4 commit 0d090a0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/expand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export async function expand(schema: string) {
7373

7474
x = [
7575
x,
76+
`# start: globals`,
7677
...document.globals.reduce((set, definition) => {
7778
const printed = print({
7879
kind: Kind.DOCUMENT,
@@ -83,6 +84,7 @@ export async function expand(schema: string) {
8384

8485
return set
8586
}, new Set<string>()),
87+
`# end: globals`,
8688
].join('\n\n')
8789

8890
return x

src/fixtures/expanded.gql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ input TagListRelationFilterInput {
247247

248248
# end: @list Tag
249249

250+
# start: globals
251+
250252
directive @signature(fields: [String!]!) on UNION
251253

252254
directive @member(type: String!, signature: String!) repeatable on UNION
@@ -324,3 +326,5 @@ scalar NullsOrder
324326
input OrderByRelationAggregateInput {
325327
_count: SortOrder
326328
}
329+
330+
# end: globals

0 commit comments

Comments
 (0)