Skip to content

Commit

Permalink
增加文档,调整缺省启动开关
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Dec 20, 2024
1 parent 02aaf74 commit 6ad1750
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
16 changes: 16 additions & 0 deletions docs/dev-guide/graphql/graphql-java.md
Original file line number Diff line number Diff line change
Expand Up @@ -632,3 +632,19 @@ CompletionStage<Object> future = graphQLEngine.fetchResult(list,
"NopAuthUser", "...F_defaults,status_label,relatedRoleList", svcCtx);
output("result.json5", FutureHelper.syncGet(future));
```

## 将同一个实体模型发布为多个不同的GraphQL对象

* NopGraphQL引擎识别的BizModel需要在`beans.xml`文件中注册。
* 注册的时候可以指定bizObjName,如果没有指定,则尝试从Java类的`@BizObjName`注解获取。

```xml
<bean id="MyUserExtBizModel" class="io.nop.graphql.demo.model.MyUserBizModel">
<property name="bizObjName" value="MyUser_ext"/>
</bean>
```

* bizObjName的格式为`{BaseName}_{extName}`,如果对应的Meta不存在,会自动查找BaseName对应的Meta。
* 可以选择增加`MyUser_ext.xmeta`,然后使用`x:extends="MyUser.xmeta"`,让它从BaseMeta继承。


4 changes: 2 additions & 2 deletions nop-demo/nop-quarkus-demo/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ nop:
password:

web:
validate-page-model: false
validate-page-model: true
auto-load-dynamic-file: false

orm:
init-database-schema: false
init-database-schema: true
db-differ:
auto-upgrade-database: false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,7 @@
/nop/dyn/model/NopDynPage/_NopDynPage.xbiz
/nop/dyn/model/NopDynPage/_NopDynPage.xmeta
/nop/dyn/model/NopDynPatch/NopDynPatch.xbiz
/nop/dyn/model/NopDynPatch/NopDynPatch.xmeta
/nop/dyn/model/NopDynPatch/_NopDynPatch.xbiz
/nop/dyn/model/NopDynPatch/_NopDynPatch.xmeta
/nop/dyn/model/NopDynPatchFile/NopDynPatchFile.xbiz
/nop/dyn/model/NopDynPatchFile/NopDynPatchFile.xmeta
/nop/dyn/model/NopDynPatchFile/_NopDynPatchFile.xbiz
Expand Down Expand Up @@ -511,11 +509,6 @@
/nop/dyn/pages/NopDynPage/main.page.yaml
/nop/dyn/pages/NopDynPage/picker.page.yaml
/nop/dyn/pages/NopDynPage/ref-module.page.yaml
/nop/dyn/pages/NopDynPatch/NopDynPatch.lib.xjs
/nop/dyn/pages/NopDynPatch/NopDynPatch.view.xml
/nop/dyn/pages/NopDynPatch/_gen/_NopDynPatch.view.xml
/nop/dyn/pages/NopDynPatch/main.page.yaml
/nop/dyn/pages/NopDynPatch/picker.page.yaml
/nop/dyn/pages/NopDynPatchFile/NopDynPatchFile.lib.xjs
/nop/dyn/pages/NopDynPatchFile/NopDynPatchFile.view.xml
/nop/dyn/pages/NopDynPatchFile/_gen/_NopDynPatchFile.view.xml
Expand Down

0 comments on commit 6ad1750

Please sign in to comment.