Skip to content

Commit 7b83249

Browse files
authored
fix: node.id in example (#154)
1 parent ac1e676 commit 7b83249

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

examples/production-app/graphql/Node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface GraphQLNode {
3030
* See: https://graphql.org/learn/global-object-identification/
3131
*
3232
* @gqlField
33-
* @killsParentOnExceptions */
33+
* @killsParentOnException */
3434
export function id(node: GraphQLNode): ID {
3535
return toGlobalId(node.__typename, node.localID());
3636
}

examples/production-app/schema.graphql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface Node {
1616
1717
See: https://graphql.org/learn/global-object-identification/
1818
"""
19-
id: ID
19+
id: ID!
2020
}
2121

2222
input CreateLikeInput {
@@ -72,7 +72,7 @@ type Like implements Node {
7272
7373
See: https://graphql.org/learn/global-object-identification/
7474
"""
75-
id: ID
75+
id: ID!
7676
"""The user who liked the post."""
7777
liker: User
7878
"""The post that was liked."""
@@ -124,7 +124,7 @@ type Post implements Node {
124124
125125
See: https://graphql.org/learn/global-object-identification/
126126
"""
127-
id: ID
127+
id: ID!
128128
"""
129129
All the likes this post has received.
130130
**Note:** You can use this connection to access the number of likes.
@@ -178,7 +178,7 @@ type User implements Node {
178178
179179
See: https://graphql.org/learn/global-object-identification/
180180
"""
181-
id: ID
181+
id: ID!
182182
"""User's name. **Note:** This field is not guaranteed to be unique."""
183183
name: String
184184
"""

examples/production-app/schema.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function getSchema(): GraphQLSchema {
3232
id: {
3333
description: "A globally unique opaque identifier for a node. Can be used to fetch the the\nnode with the `node` or `nodes` fields.\n\nSee: https://graphql.org/learn/global-object-identification/",
3434
name: "id",
35-
type: GraphQLID
35+
type: new GraphQLNonNull(GraphQLID)
3636
}
3737
};
3838
}
@@ -55,7 +55,7 @@ export function getSchema(): GraphQLSchema {
5555
id: {
5656
description: "A globally unique opaque identifier for a node. Can be used to fetch the the\nnode with the `node` or `nodes` fields.\n\nSee: https://graphql.org/learn/global-object-identification/",
5757
name: "id",
58-
type: GraphQLID,
58+
type: new GraphQLNonNull(GraphQLID),
5959
resolve(source) {
6060
return postIdResolver(source);
6161
}
@@ -170,7 +170,7 @@ export function getSchema(): GraphQLSchema {
170170
id: {
171171
description: "A globally unique opaque identifier for a node. Can be used to fetch the the\nnode with the `node` or `nodes` fields.\n\nSee: https://graphql.org/learn/global-object-identification/",
172172
name: "id",
173-
type: GraphQLID,
173+
type: new GraphQLNonNull(GraphQLID),
174174
resolve(source) {
175175
return userIdResolver(source);
176176
}
@@ -225,7 +225,7 @@ export function getSchema(): GraphQLSchema {
225225
id: {
226226
description: "A globally unique opaque identifier for a node. Can be used to fetch the the\nnode with the `node` or `nodes` fields.\n\nSee: https://graphql.org/learn/global-object-identification/",
227227
name: "id",
228-
type: GraphQLID,
228+
type: new GraphQLNonNull(GraphQLID),
229229
resolve(source) {
230230
return likeIdResolver(source);
231231
}

0 commit comments

Comments
 (0)