@@ -85,26 +85,61 @@ public static Options defaultOptions() {
8585 Integer .MAX_VALUE );
8686 }
8787
88+ /**
89+ * Locale to use when parsing the query.
90+ * <p>
91+ * e.g. can be passed to {@link graphql.schema.Coercing} for parsing.
92+ *
93+ * @param locale the locale to use
94+ * @return new options object to use
95+ */
8896 public Options locale (Locale locale ) {
8997 return new Options (this .graphQLContext , locale , this .maxChildrenDepth );
9098 }
9199
100+ /**
101+ * Context object to use when parsing the operation.
102+ * <p>
103+ * Can be used to intercept input values e.g. using {@link graphql.execution.values.InputInterceptor}.
104+ *
105+ * @param graphQLContext the context to use
106+ * @return new options object to use
107+ */
92108 public Options graphQLContext (GraphQLContext graphQLContext ) {
93109 return new Options (graphQLContext , this .locale , this .maxChildrenDepth );
94110 }
95111
112+ /**
113+ * Controls the maximum depth of the operation. Can be used to prevent
114+ * against malicious operations.
115+ *
116+ * @param maxChildrenDepth the max depth
117+ * @return new options object to use
118+ */
96119 public Options maxChildrenDepth (int maxChildrenDepth ) {
97120 return new Options (this .graphQLContext , this .locale , maxChildrenDepth );
98121 }
99122
123+ /**
124+ * @return context to use during operation parsing
125+ * @see #graphQLContext(GraphQLContext)
126+ */
100127 public GraphQLContext getGraphQLContext () {
101128 return graphQLContext ;
102129 }
103130
131+ /**
132+ * @return locale to use during operation parsing
133+ * @see #locale(Locale)
134+ */
104135 public Locale getLocale () {
105136 return locale ;
106137 }
107138
139+ /**
140+ * @return maximum children depth before aborting parsing
141+ * @see #maxChildrenDepth(int)
142+ */
108143 public int getMaxChildrenDepth () {
109144 return maxChildrenDepth ;
110145 }
0 commit comments