Skip to content

Commit c651c21

Browse files
committed
Clarify units in MaxPooledBufferCap readme line
1 parent e3da7f9 commit c651c21

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ schema := graphql.MustParseSchema(sdl, &RootResolver{}, nil)
149149
- `UseFieldResolvers()` specifies whether to use struct field resolvers.
150150
- `MaxDepth(n int)` specifies the maximum field nesting depth in a query. The default is 0 which disables max depth checking.
151151
- `MaxParallelism(n int)` specifies the maximum number of resolvers per request allowed to run in parallel. The default is 10.
152-
- `MaxPooledBufferCap(n int)` specifies the maximum buffer size in bytes that will be pooled. Increase to reduce allocations, set to `0` to disable buffer pooling. The default is 8KB.
152+
- `MaxPooledBufferCap(nBytes int)` specifies the maximum buffer size in bytes that will be pooled. Increase to reduce allocations, set to `0` to disable buffer pooling. The default is 8KB.
153153
- `Tracer(tracer trace.Tracer)` is used to trace queries and fields. It defaults to `noop.Tracer`.
154154
- `Logger(logger log.Logger)` is used to log panics during query execution. It defaults to `exec.DefaultLogger`.
155155
- `PanicHandler(panicHandler errors.PanicHandler)` is used to transform panics into errors during query execution. It defaults to `errors.DefaultPanicHandler`.

graphql.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ func MaxParallelism(n int) SchemaOpt {
151151
// MaxPooledBufferCap sets the maximum buffer capacity (in bytes) for pooled buffers.
152152
// Buffers larger than this will not be returned to the pool. The default is 8KB.
153153
// Set to 0 to disable buffer pooling entirely (not recommended for most use cases).
154-
func MaxPooledBufferCap(n int) SchemaOpt {
155-
return func(s *Schema) { s.maxPooledBufferCap = n }
154+
func MaxPooledBufferCap(nBytes int) SchemaOpt {
155+
return func(s *Schema) { s.maxPooledBufferCap = nBytes }
156156
}
157157

158158
// MaxQueryLength specifies the maximum allowed query length in bytes. The default is 0 which disables max length checking.

0 commit comments

Comments
 (0)