-
-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Error Handling for createMember
, createAdmin
, createComment
#2448
Comments
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
Do we see any issues after the changes/ are we known to bugs caused after implementation of talawa-api#1746. If so i am interested for working on this project and can start with this issue. |
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
@TirthNisar193 Are you working on this? |
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
Unassigning due to no activity or open PR. |
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
I would like to work on this issue. Please assign me. |
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
@rohansen856 This has been assigned to you |
@palisadoes I have confirmed the code changes of the following mutation: if (!currentUser) {
return {
organization: new Organization(),
userErrors: [
{
__typename: "UserNotFoundError",
message: requestContext.translate(USER_NOT_FOUND_ERROR.MESSAGE),
},
],
};
} instead of: if (!currentUser) {
throw new errors.NotFoundError(
requestContext.translate(USER_NOT_FOUND_ERROR.MESSAGE),
USER_NOT_FOUND_ERROR.CODE,
USER_NOT_FOUND_ERROR.PARAM
);
} These errors do not affect the workings of this app as the Future<void> createComments(String postId, String text) async {
final String createCommentQuery = CommentQueries().createComment();
try {
await _dbFunctions.gqlAuthMutation(
createCommentQuery,
variables: {
'postId': postId, //Add your variables here
'text': text,
},
);
_navigationService.showTalawaErrorSnackBar(
"Comment sent",
MessageType.info,
);
} on Exception catch (_) {
_navigationService.showTalawaErrorSnackBar(
"Something went wrong",
MessageType.error,
);
}
}
for the createMember part in organisations, same type of functionality happens. The queries defined in: According to my review, The changes in the |
@noman2002 What do you think? |
@rohansen856 Aren't the graphql query going through backend ? I don't think its writing into the database directly. Please investigate into this. If its not going through backend route then we need to fix it. |
Thanks for the reply @noman2002 |
@noman2002 from what i understand for the createComments function for now, the involved functionalities are: /// * String: The query for creating a comment
String createComment() {
return """
mutation createComment(\$postId: ID!, \$text: String!) {
createComment(postId: \$postId,
data:{
text: \$text,
}
){
_id
}
}
""";
} this function that generates a GraphQL mutation string for creating a comment on a post, Future<void> createComments(String postId, String text) async {
final String createCommentQuery = CommentQueries().createComment();
try {
await _dbFunctions.gqlAuthMutation(
createCommentQuery,
variables: {
'postId': postId, //Add your variables here
'text': text,
},
);
_navigationService.showTalawaErrorSnackBar(
"Comment sent",
MessageType.info,
);
} on Exception catch (_) {
_navigationService.showTalawaErrorSnackBar(
"Something went wrong",
MessageType.error,
);
}
} here, the Future<QueryResult<Object?>> gqlAuthMutation(
String mutation, {
Map<String, dynamic>? variables,
}) async {
final MutationOptions options = MutationOptions(
document: gql(mutation),
variables: variables ?? <String, dynamic>{},
);
final response = await cacheService.executeOrCacheOperation(
operation: mutation,
variables: variables,
operationType: CachedOperationType.gqlAuthMutation,
whenOnline: () async {
final QueryResult result = await clientAuth.mutate(options);
print(result);
// If there is an error or exception in [result]
if (result.hasException) {
GraphqlExceptionResolver.encounteredExceptionOrError(
result.exception!,
);
} else if (result.data != null && result.isConcrete) {
return result;
}
return noData;
},
);
return response;
} finally, |
During the week of November 11, 2024 we will start a code freeze on the We have completed a project to convert the Talawa-API backend to use PostgreSQL. Work will then begin with us merging code in the Planning activities for this will be managed in our #talawa-projects slack channel. A GitHub project will be created to track specially labeled issues. We completed a similar exercise last year using a similar methodology. Starting November 12, California time no new PRs will be accepted against the There are some GSoC project features that will need to be merged into develop. These will be the only exceptions. This activity and the post GSoC 2024 start date was announced in our #general Slack channel last month as a pinned post. |
You can proceed with your approach. |
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
@rohansen856 Are you working on this? |
unassigning. Inactivity |
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
Describe the bug
createMember
,createAdmin
,createComment
Expected behavior
Actual behavior
Screenshots
Additional details
Potential internship candidates
The text was updated successfully, but these errors were encountered: