public enum ContextSetting extends java.lang.Enum<ContextSetting>
| Enum Constant and Description |
|---|
PER_QUERY_WITH_INSTRUMENTATION
Each GraphQL execution should always have its own context.
|
PER_QUERY_WITHOUT_INSTRUMENTATION |
PER_REQUEST_WITH_INSTRUMENTATION
A context object, and therefor dataloader registry and subject, should be shared between all GraphQL executions in a http request.
|
PER_REQUEST_WITHOUT_INSTRUMENTATION |
| Modifier and Type | Method and Description |
|---|---|
java.util.function.Supplier<graphql.execution.instrumentation.Instrumentation> |
configureInstrumentationForContext(java.util.function.Supplier<graphql.execution.instrumentation.Instrumentation> instrumentation,
java.util.List<graphql.ExecutionInput> executionInputs,
graphql.execution.instrumentation.dataloader.DataLoaderDispatcherInstrumentationOptions options)
Augments the provided instrumentation supplier to also supply the correct dispatching instrumentation.
|
GraphQLBatchedInvocationInput |
getBatch(java.util.List<GraphQLRequest> requests,
graphql.schema.GraphQLSchema schema,
java.util.function.Supplier<GraphQLContext> contextSupplier,
java.lang.Object root)
Creates a set of inputs with the correct context based on the setting.
|
static ContextSetting |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ContextSetting[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ContextSetting PER_REQUEST_WITH_INSTRUMENTATION
public static final ContextSetting PER_REQUEST_WITHOUT_INSTRUMENTATION
public static final ContextSetting PER_QUERY_WITH_INSTRUMENTATION
public static final ContextSetting PER_QUERY_WITHOUT_INSTRUMENTATION
public static ContextSetting[] values()
for (ContextSetting c : ContextSetting.values()) System.out.println(c);
public static ContextSetting valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic GraphQLBatchedInvocationInput getBatch(java.util.List<GraphQLRequest> requests, graphql.schema.GraphQLSchema schema, java.util.function.Supplier<GraphQLContext> contextSupplier, java.lang.Object root)
requests - the GraphQL requests to execute.schema - the GraphQL schema to execute the requests against.contextSupplier - method that returns the context to use for each execution or for the request as a whole.root - the root object to use for each execution.public java.util.function.Supplier<graphql.execution.instrumentation.Instrumentation> configureInstrumentationForContext(java.util.function.Supplier<graphql.execution.instrumentation.Instrumentation> instrumentation,
java.util.List<graphql.ExecutionInput> executionInputs,
graphql.execution.instrumentation.dataloader.DataLoaderDispatcherInstrumentationOptions options)
instrumentation - the instrumentation supplier to augmentexecutionInputs - the inputs that will be dispatched by the instrumentationoptions - the DataLoader dispatching instrumentation options that will be used.