Skip to content

Commit

Permalink
自动忽略_replace=1参数
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Dec 4, 2023
1 parent eb41553 commit 8aa971e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@
[
[
"io.nop.auth.dao.mapper.NopAuthRoleMapper"
],
[
"io.nop.auth.dao.mapper.NopAuthUserMapper"
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface GraphQLErrors {

String ARG_OBJ_NAME = "objName";
String ARG_FIELD_NAME = "fieldName";
String ARG_ALLOWED_NAMES = "definedFields";
String ARG_ALLOWED_NAMES = "allowedNames";

String ARG_PARENT_NAME = "parentName";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ public void initRpcContext(IGraphQLExecutionContext context, GraphQLOperationTyp

void checkOperationArgs(GraphQLFieldDefinition field, Map<String, Object> data) {
for (String name : data.keySet()) {
// 忽略以_为前缀的属性。AMIS的schemaApi会自动添加_replace=1
if(name.startsWith("_"))
continue;

if (field.getArg(name) == null)
throw new NopException(ERR_GRAPHQL_UNKNOWN_OPERATION_ARG)
.param(ARG_OPERATION_NAME, field.getOperationName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public CompletionStage<ResponseEntity<Object>> restSpring(@PathVariable("operati
@RequestParam(value = SYS_PARAM_SELECTION, required = false) String selection,
@RequestBody(required = false) String body) {
return runRest(null, operationName, () -> {
return (ApiRequest<?>) buildRequest(body, selection, true);
return buildRequest(body, selection, true);
}, this::transformRestResponse);
}

Expand Down

0 comments on commit 8aa971e

Please sign in to comment.