Package com.jsgalactic.axiom.graphql
Record Class GraphQlOptions
java.lang.Object
java.lang.Record
com.jsgalactic.axiom.graphql.GraphQlOptions
- Record Components:
maxBodyBytes- maximum request body in bytes, 1 to 1048576maxDepth- maximum query depth enforced by graphql-java, 1 to 100maxComplexity- maximum query complexity enforced by graphql-java, 1 to 100000introspection- whether__schemaand__typemay be queriedgetQueries- whether queries (never mutations) may be sent as GET with query parameters
public record GraphQlOptions(int maxBodyBytes, int maxDepth, int maxComplexity, boolean introspection, boolean getQueries)
extends Record
Bounds and switches of a
GraphQl handler, supplied as plain data.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GraphQlOptionsBounded defaults: 64 KiB body, depth 10, complexity 100, no introspection, POST only. -
Constructor Summary
ConstructorsConstructorDescriptionGraphQlOptions(int maxBodyBytes, int maxDepth, int maxComplexity, boolean introspection, boolean getQueries) Validates the bounds so a handler can never be built with unbounded work. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of thegetQueriesrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theintrospectionrecord component.intReturns the value of themaxBodyBytesrecord component.intReturns the value of themaxComplexityrecord component.intmaxDepth()Returns the value of themaxDepthrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
Bounded defaults: 64 KiB body, depth 10, complexity 100, no introspection, POST only.
-
-
Constructor Details
-
GraphQlOptions
public GraphQlOptions(int maxBodyBytes, int maxDepth, int maxComplexity, boolean introspection, boolean getQueries) Validates the bounds so a handler can never be built with unbounded work.- Throws:
IllegalArgumentException- if a bound is outside its range
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
maxBodyBytes
public int maxBodyBytes()Returns the value of themaxBodyBytesrecord component.- Returns:
- the value of the
maxBodyBytesrecord component
-
maxDepth
public int maxDepth()Returns the value of themaxDepthrecord component.- Returns:
- the value of the
maxDepthrecord component
-
maxComplexity
public int maxComplexity()Returns the value of themaxComplexityrecord component.- Returns:
- the value of the
maxComplexityrecord component
-
introspection
public boolean introspection()Returns the value of theintrospectionrecord component.- Returns:
- the value of the
introspectionrecord component
-
getQueries
public boolean getQueries()Returns the value of thegetQueriesrecord component.- Returns:
- the value of the
getQueriesrecord component
-