Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions content/tools/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Add the `graphql-java-tools` dependency:

```gradle
dependencies {
implementation 'io.github.graphql-java-kickstart:graphql-java-tools:14.4.0'
implementation 'io.github.graphql-java-kickstart:graphql-java-tools:14.5.0'
}
```

Expand All @@ -46,10 +46,12 @@ Add the `graphql-java-tools` dependency:
<dependency>
<groupId>io.github.graphql-java-kickstart</groupId>
<artifactId>graphql-java-tools</artifactId>
<version>14.4.0</version>
<version>14.5.0</version>
</dependency>
```

The [release notes](https://github.com/graphql-java-kickstart/graphql-java-tools/releases) list what changed in each version, including behaviour changes and breaking changes.

## Using the latest development build

Snapshot versions of the current `master` branch are available on the Maven Central snapshot repository. Check the next snapshot version on
Expand Down
9 changes: 9 additions & 0 deletions content/tools/schema-definition/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@ SchemaParser.newParser()
.scalars(myUuidScalar)
```

The scalar's definition in the schema, and its `extend scalar` extensions, can add a description and directives:
```graphql
"A calendar date"
scalar Date @specifiedBy(url: "https://tools.ietf.org/html/rfc3339")
```

A description or `@specifiedBy` URL in the schema replaces the one of the scalar instance. Without one, the scalar keeps its own.
The scalar gets only the directives that the schema applies, not those of the scalar instance, and their [directive wirings]({{< relref "/tools/directives/index.md" >}}) run `onScalar`.

## Type Dictionary

Sometimes GraphQL Java Tools can't find classes when it scans your objects, usually because of limitations with interface and union types. Sometimes your Java classes don't line up perfectly with your GraphQL schema, either. GraphQL Java Tools allows you to provide additional classes manually and "rename" them if desired:
Expand Down
11 changes: 10 additions & 1 deletion content/tools/schema-parser-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@ Options:
* Guice
* Spring AOP
* Weld
* `introspectionEnabled`: Defaults to `true`. When set to `false` this option will disable schema introspection via `NO_INTROSPECTION_FIELD_VISIBILITY`. See [Field Visibility](https://www.graphql-java.com/documentation/field-visibility).
* `introspectionEnabled`: Deprecated, and will be removed in 15.0.0. Defaults to `true`. When set to `false`, every field of the introspection types is hidden, so an introspection query fails validation.
Turn introspection off with graphql-java instead, for the whole JVM or for one request:
```java
Introspection.enabledJvmWide(false);

var executionInput = ExecutionInput.newExecutionInput()
.query(query)
.graphQLContext(Map.of(Introspection.INTROSPECTION_DISABLED, true));
```
An introspection query then fails with an "introspection disabled" error when it runs.
* `fieldVisibility`: Provide a graphql field visibility implementation. This option overrides `introspectionEnabled` when used. See [Field Visibility](https://www.graphql-java.com/documentation/field-visibility).
* `coroutineContext` / `coroutineContextProvider`: Provide a kotlin coroutine context to be used with suspend functions of resolvers.
A suspend function runs on the calling thread until it first suspends, and continues on this context after that, so wrap blocking calls in `withContext(Dispatchers.IO)`.
Expand Down