Skip to content

Commit

Permalink
fix-maxBufSize-less-than-preferredBufSize scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Laoulakos committed Feb 1, 2024
1 parent 5d34cd3 commit 294a72f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions client/src/main/scala/caliban/client/SelectionBuilder.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package caliban.client

import caliban.client.CalibanClientError.{CommunicationError, DecodingError, ServerError}
import caliban.client.CalibanClientError.{ CommunicationError, DecodingError, ServerError }
import caliban.client.FieldBuilder.Scalar
import caliban.client.Operations.IsOperation
import caliban.client.Selection.Directive
Expand All @@ -10,9 +10,10 @@ import com.github.plokhotnyuk.jsoniter_scala.core._
import sttp.client3._
import sttp.client3.jsoniter._
import sttp.model.Uri
import scala.collection.immutable.{Map => SMap}
import scala.collection.immutable.{ Map => SMap }
import scala.util.control.NonFatal
import scala.math.max

/**
* Represents a selection from parent type `Origin` that returns a result of type `A`.
*/
Expand Down Expand Up @@ -73,8 +74,11 @@ sealed trait SelectionBuilder[-Origin, +A] { self =>
readFromString[GraphQLResponse](
payload,
// allow parsing of large payloads
ReaderConfig.withMaxBufSize(max(max(payload.length, ReaderConfig.maxBufSize), ReaderConfig.preferredBufSize))
.withMaxCharBufSize(max(max(payload.length, ReaderConfig.maxCharBufSize), ReaderConfig.preferredCharBufSize))
ReaderConfig
.withMaxBufSize(max(max(payload.length, ReaderConfig.maxBufSize), ReaderConfig.preferredBufSize))
.withMaxCharBufSize(
max(max(payload.length, ReaderConfig.maxCharBufSize), ReaderConfig.preferredCharBufSize)
)
)
)
catch {
Expand Down

0 comments on commit 294a72f

Please sign in to comment.