You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/tools/schema-parser-options/index.md
+14-1Lines changed: 14 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -14,11 +14,14 @@ Use `SchemaParserOptions.newBuilder()` to build an options object to pass to the
14
14
15
15
Options:
16
16
17
+
*`contextClass`: If you use a context object to execute your queries, let the parser know about it so that it can add it to data fetchers as an argument.
17
18
*`genericWrappers`: Allows defining your own generic classes that should be unwrapped when matching Java types to GraphQL types. You must supply the class and the index (zero-indexed) of the wrapped generic type. For example: If you want to unwrap type argument `T` of `Future<T>`, you must pass `Future.class` and `0`.
18
19
19
20
*`useDefaultGenericWrappers`: Defaults to `true`. Tells the parser whether or not to add it's own list of well-known generic wrappers, such as `Future` and `CompletableFuture`.
20
21
*`allowUnimplementedResolvers`: Defaults to `false`. Allows a schema to be created even if not all GraphQL fields have resolvers. Intended only for development, it will log a warning to remind you to turn it off for production. Any unimplemented resolvers will throw errors when queried.
21
-
*`objectMapperConfigurer`: Exposes the Jackson `ObjectMapper` that handles marshalling arguments in method resolvers. Every method resolver gets its own mapper, and the configurer can configure it differently based on the GraphQL field definition.
22
+
*`missingResolverDataFetcher`: Allows you to provide custom behavior for missing GraphQL fields.
23
+
*`inputArgumentOptionalDetectOmission`: Defaults to `false`. By default, the parser will treat omitted or null method input arguments as `Optional.empty` in resolvers. If you prefer, you can disable this behavior.
24
+
*`objectMapperConfigurer` / `objectMapperProvider`: Exposes the Jackson `ObjectMapper` that handles marshalling arguments in method resolvers. Every method resolver gets its own mapper, and the configurer can configure it differently based on the GraphQL field definition.
22
25
*`preferGraphQLResolver`: In cases where you have a Resolver class and legacy class that conflict on type arguments, use the Resolver class instead of throwing an error.
23
26
Specifically this situation can occur when you have a graphql schema type `Foo` with a `bars` property and classes:
24
27
```java
@@ -38,3 +41,13 @@ Options:
38
41
```
39
42
You will now have the code find two different return types for getBars() and application will not start with the error ```Caused by:com.coxautodev.graphql.tools.SchemaClassScannerError:Two different classes used for type```
40
43
Ifthis property is true it will ignore the legacy version.
44
+
* `addProxyHandler`:If your runtime resolver classes are auto-generated proxies of some kind you can provide a handler to help the parser find the real resolvers behind them. Four proxy handlers are provided by defaultfor these libraries:
45
+
*Javassist
46
+
*Guice
47
+
*SpringAOP
48
+
*Weld
49
+
* `introspectionEnabled`:Defaults to `true`.When set to `false` this option will disable schema introspection via `NO_INTROSPECTION_FIELD_VISIBILITY`.See [FieldVisibility](https://www.graphql-java.com/documentation/master/fieldvisibility/).
50
+
* `fieldVisibility`:Provide a graphql field visibility implementation. This option overrides `introspectionEnabled` when used. See [FieldVisibility](https://www.graphql-java.com/documentation/master/fieldvisibility/).
51
+
* `coroutineContext` / `coroutineContextProvider`:Provide a kotlin coroutine context to be used with suspend functions of resolvers.
* `includeUnusedTypes`:Defaults to `false`.Bydefault, the parser will ignore unused type definitions in the schema. Enablethis option to include them regardless.
0 commit comments