= GraphQL API
:page-role: -toc -narrow


: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 agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

include::../section-hooks/causeway.viewer.graphql~pre.adoc[]

[cols="3a,2a,5a", options="header"]
|===
|Property
|Default
|Description
|
[[causeway.viewer.graphql.api-scope]]
causeway.viewer.graphql.api-scope

|  all
| Which domain objects to include the GraphQL schema. By default, all domain objects are exposed (entities and view models).


|
[[causeway.viewer.graphql.api-variant]]
causeway.viewer.graphql. +
api-variant

|  query-and-mutations
| Which variant of API to expose: `ApiVariant#QUERY++_++ONLY` (which suppresses any actions that mutate the state of the system), or as `ApiVariant#QUERY++_++AND++_++MUTATIONS` (which additionally exposes actions that mutate the system as mutations) or alternatively as `ApiVariant#QUERY++_++WITH++_++MUTATIONS++_++NON++_++SPEC++_++COMPLIANT`, a query-only schema that relaxes the read-only rule by exposing actions that mutate the system; it is therefore not compliant with the GraphQL spec),


|
[[causeway.viewer.graphql.authentication.fallback.roles]]
causeway.viewer.graphql. +
authentication.fallback.roles

| 
| Used as the set of roles for the default username (if not provided by other means).


|
[[causeway.viewer.graphql.authentication.fallback.username]]
causeway.viewer.graphql. +
authentication.fallback.username

| 
| Used as the default username (if not provided by other means).


|
[[causeway.viewer.graphql.lookup.arg-name]]
causeway.viewer.graphql.lookup. +
arg-name

|  object
| This is the name of the synthetic first argument used to locate the object to be looked up.


|
[[causeway.viewer.graphql.lookup.field-name-prefix]]
causeway.viewer.graphql.lookup. +
field-name-prefix

| 
| Lookup field prefix


|
[[causeway.viewer.graphql.lookup.field-name-suffix]]
causeway.viewer.graphql.lookup. +
field-name-suffix

| 
| Lookup field suffix


|
[[causeway.viewer.graphql.meta-data.field-name]]
causeway.viewer.graphql.meta-data. +
field-name

|  _meta
| Note that field names _cannot_ being with "++__++", as that is reserved by the underlying GraphQL implementation.


|
[[causeway.viewer.graphql.mutation.target-arg-name]]
causeway.viewer.graphql.mutation. +
target-arg-name

|  _target
| The name of the synthetic argument of mutators representing the target domain object.


|
[[causeway.viewer.graphql.resources.response-type]]
causeway.viewer.graphql.resources. +
response-type

|  forbidden
| How resources (`Blob` bytes, `Clob` chars, grids and icons) can be downloaded from the resource controller.

By default the download of these resources if `ResponseType#FORBIDDEN`, but alternatively they can be enabled to download either `ResponseType#DIRECT`ly or as an `ResponseType#ATTACHMENT`.


|
[[causeway.viewer.graphql.scalar-marshaller.local-date-format]]
causeway.viewer.graphql. +
scalar-marshaller. +
local-date-format

|  yyyy-MM-dd
| For both JDK8's `LocalDate` and JodaTime's `LocalDate`


|
[[causeway.viewer.graphql.scalar-marshaller.local-time-format]]
causeway.viewer.graphql. +
scalar-marshaller. +
local-time-format

|  HH:mm:ss
| For both JDK8's `LocalTime` and JodaTime's `LocalTime`


|
[[causeway.viewer.graphql.scalar-marshaller.zoned-date-time-format]]
causeway.viewer.graphql. +
scalar-marshaller. +
zoned-date-time-format

|  yyyy-MM-dd'T'HH:mm:ssXXX
| for JDK8's `ZonedDateTime` and JodaTime's `DateTime`


|
[[causeway.viewer.graphql.schema-style]]
causeway.viewer.graphql. +
schema-style

|  rich-and-simple
| Which `SchemaStyle` to expose, "simple" or "rich". By default both are exposed under top-level field names. @see Schema.Rich#getTopLevelFieldName() @see Schema.Simple#getTopLevelFieldName()


|
[[causeway.viewer.graphql.schema.rich.enable-scenario-testing]]
causeway.viewer.graphql.schema. +
rich.enable-scenario-testing

| 
| If the `#getSchemaStyle()` is set to either `SchemaStyle#RICH++_++ONLY` or `SchemaStyle#SIMPLE++_++AND++_++RICH`, then determines whether the "Scenario" field is included in order to allow given/when/then tests to be expressed.

Ignored if the `#getSchemaStyle()` is `SchemaStyle#SIMPLE++_++ONLY`.


|
[[causeway.viewer.graphql.schema.rich.top-level-field-name]]
causeway.viewer.graphql.schema. +
rich.top-level-field-name

|  rich
| If the `#getSchemaStyle()` is set to `SchemaStyle#SIMPLE++_++AND++_++RICH`, defines the name of the top-level field under which the "rich" schema resides.

Ignored for any other `#getSchemaStyle()`.


|
[[causeway.viewer.graphql.schema.simple.top-level-field-name]]
causeway.viewer.graphql.schema. +
simple.top-level-field-name

|  simple
| If the `#getSchemaStyle()` is set to `SchemaStyle#SIMPLE++_++AND++_++RICH`, defines the name of the top-level field under which the "simple" schema resides.

Ignored for any other `#getSchemaStyle()`.



|===

include::../section-hooks/causeway.viewer.graphql~post.adoc[]
