This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-3676
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 2f745316e4a72dc13f0099df0acfd38a1533142a
Author: danhaywood <[email protected]>
AuthorDate: Mon Mar 11 15:15:47 2024 +0000

    CAUSEWAY-3676: adds docs for asciiId
---
 viewers/graphql/adoc/modules/ROOT/pages/i18n.adoc  | 31 ++++++++++++++++++++++
 .../adoc/modules/ROOT/partials/module-nav.adoc     |  1 +
 2 files changed, 32 insertions(+)

diff --git a/viewers/graphql/adoc/modules/ROOT/pages/i18n.adoc 
b/viewers/graphql/adoc/modules/ROOT/pages/i18n.adoc
new file mode 100644
index 0000000000..3559769d2a
--- /dev/null
+++ b/viewers/graphql/adoc/modules/ROOT/pages/i18n.adoc
@@ -0,0 +1,31 @@
+= i18n Concerns
+
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements. See the NOTICE file distributed with this work 
for additional information regarding copyright ownership. The ASF licenses this 
file to you under the Apache License, Version 2.0 (the "License"); you may not 
use this file except in compliance with the License. You may obtain a copy of 
the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by 
applicable law or ag [...]
+
+
+The GraphQL Specification 
(link:https://spec.graphql.org/June2018/#sec-Names[]) requires that names of 
fields and types use only a subset of ASCII characters.
+On the other hand the GraphQL viewer will infer these fields from the Java 
domain objects, which permits a wider range of characters.
+
+To ensure that only permitted characters are used in the GraphQL model, use 
the 
xref:refguide:applib:index/annotation/Property.adoc#asciiId[@Property#asciiId], 
xref:refguide:applib:index/annotation/Collection.adoc#asciiId[@Collection#asciiId],
 xref:refguide:applib:index/annotation/Action.adoc#asciiId[@Action#asciiId] and 
xref:refguide:applib:index/annotation/Parameter.adoc#asciiId[@Parameter#asciiId].
+
+For example:
+
+[source,java]
+.I18nCalculator
+----
+@Named("university.calc.I18nCalculator")
+@DomainService(nature= NatureOfService.VIEW)
+@Priority(PriorityPrecedence.EARLY)
+@RequiredArgsConstructor(onConstructor_ = {@Inject})
+public class I18nCalculator {
+
+    @Action(semantics = SemanticsOf.SAFE, asciiId = "concat")
+    public String concät(
+            @Parameter(asciiId = "a1")
+            String ä1,
+            @Parameter(asciiId = "a2")
+            String ä2) {
+        return ä1 + ä2;
+    }
+}
+----
diff --git a/viewers/graphql/adoc/modules/ROOT/partials/module-nav.adoc 
b/viewers/graphql/adoc/modules/ROOT/partials/module-nav.adoc
index 00f1fac590..cac18d5ba9 100644
--- a/viewers/graphql/adoc/modules/ROOT/partials/module-nav.adoc
+++ b/viewers/graphql/adoc/modules/ROOT/partials/module-nav.adoc
@@ -2,4 +2,5 @@
 * xref:gqlv:ROOT:setup-and-configuration.adoc[]
 * xref:gqlv:ROOT:testsupport.adoc[]
 * xref:gqlv:ROOT:spi-services.adoc[]
+* xref:gqlv:ROOT:i18n.adoc[]
 

Reply via email to