Skip to content

Commit 3d126a3

Browse files
committed
simplify++
1 parent de2b1e9 commit 3d126a3

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

src/test-suites/i-will-name-you-later/a.subgraph.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ export default createSubgraph("a", {
1515
1616
type Post @key(fields: "id") {
1717
id: ID!
18-
comments(limit: Int!): [Comment] @external
18+
authorId: ID @external
19+
author: Author @requires(fields: "authorId")
1920
}
2021
2122
type Comment @key(fields: "id") {
2223
id: ID!
2324
authorId: ID
24-
body: String!
25-
sameCommentOnOtherPosts: [Post] @external
26-
isCommentSpam: Boolean
27-
@requires(
28-
fields: "sameCommentOnOtherPosts { comments(limit: 50) { id } }"
29-
)
25+
}
26+
27+
type Author {
28+
id: ID!
29+
name: String
3030
}
3131
`,
3232
resolvers: {

src/test-suites/i-will-name-you-later/b.subgraph.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,13 @@ export default createSubgraph("b", {
1111
1212
type Post @key(fields: "id") {
1313
id: ID!
14-
author: Author @requires(fields: "comments(limit: 3) { authorId }")
15-
comments(limit: Int!): [Comment]
14+
authorId: ID @requires(fields: "comments { authorId }")
15+
comments: Comment
1616
}
1717
1818
type Comment @key(fields: "id") {
1919
id: ID!
20-
date: String
2120
authorId: ID @external
22-
sameCommentOnOtherPosts: [Post]
23-
}
24-
25-
type Author {
26-
id: ID!
27-
name: String
2821
}
2922
`,
3023
resolvers: {

0 commit comments

Comments
 (0)