@@ -33,7 +33,7 @@ class User {
3333 if ( info . errors ) throw new Error ( `Replit GraphQL Error(s): ${ JSON . stringify ( info . errors ) } ` )
3434
3535 if ( ! info . data . userByUsername ) {
36- throw new Error ( `${ user } is not a user. Please query users on Repl.it .` ) ;
36+ throw new Error ( `${ user } is not a user. Please query users on Replit .` ) ;
3737 } else {
3838 return info . data . userByUsername ;
3939 }
@@ -64,10 +64,10 @@ class User {
6464 user { ${ constants . userAttributes } },
6565 board { ${ constants . boardAttributes } },
6666 repl { ${ constants . replAttributes } },
67- comments(count: 10 ) { ${ constants . commentAttributes } },
67+ comments(count: ${ global . initVariables . previewCount . comments || 10 } ) { ${ constants . commentAttributes } },
6868 votes { id, user { ${ constants . userAttributes } } },
6969 answeredBy { ${ constants . userAttributes } },
70- answer { ${ constants . commentAttributes } }
70+ answer { ${ constants . commentAttributes } }
7171 }
7272 pageInfo {
7373 nextCursor
@@ -85,9 +85,11 @@ class User {
8585 } )
8686 . then ( res => res . json ( ) ) ;
8787
88+ if ( info . errors ) throw new Error ( `Replit GraphQL Error(s): ${ JSON . stringify ( info . errors ) } ` )
89+
8890 if ( ! info . data . userByUsername ) {
8991 throw new Error (
90- `${ user } is not a user. Please query users on Repl.it .`
92+ `${ user } is not a user. Please query users on Replit .`
9193 ) ;
9294 } else {
9395 info . data . userByUsername . posts . items . forEach ( post => {
@@ -123,7 +125,22 @@ class User {
123125 query UserComment($user: String!, $after: String!, $count: Int!, $order: String!) {
124126 userByUsername(username: $user) {
125127 comments(count: $count, after: $after, order: $order) {
126- items { ${ variables . commentAttributes } }
128+ items {
129+ ${ constants . commentAttributes } ,
130+ parentComment { ${ constants . commentAttributes } },
131+ comments(count: ${ global . initVariables . previewCount . comments || 10 } ) { ${ constants . commentAttributes } },
132+ user { ${ constants . userAttributes } },
133+ post {
134+ ${ constants . postAttributes } ,
135+ user { ${ constants . userAttributes } },
136+ board { ${ constants . boardAttributes } },
137+ repl { ${ constants . replAttributes } },
138+ comments(count: ${ global . initVariables . previewCount . comments || 10 } ) { ${ constants . commentAttributes } },
139+ votes { id, user { ${ constants . userAttributes } } },
140+ answeredBy { ${ constants . userAttributes } },
141+ answer { ${ constants . commentAttributes } }
142+ }
143+ }
127144 pageInfo {
128145 nextCursor
129146 }
@@ -140,9 +157,11 @@ class User {
140157 } )
141158 . then ( res => res . json ( ) ) ;
142159
160+ if ( info . errors ) throw new Error ( `Replit GraphQL Error(s): ${ JSON . stringify ( info . errors ) } ` )
161+
143162 if ( ! info . data . userByUsername ) {
144163 throw new Error (
145- `${ user } is not a user. Please query users on Repl.it .`
164+ `${ user } is not a user. Please query users on Replit .`
146165 ) ;
147166 } else {
148167 info . data . userByUsername . comments . items . forEach ( comment => {
0 commit comments