Skip to content

Commit e3da7f9

Browse files
committed
Fix readme
1 parent a2fae60 commit e3da7f9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,11 @@ For more realistic usecases check our [examples section](https://github.com/grap
6161
### Resolvers
6262

6363
A resolver must have one method or field for each field of the GraphQL type it resolves. The method or field name has to be [exported](https://golang.org/ref/spec#Exported_identifiers) and match the schema's field's name in a non-case-sensitive way.
64-
6564
You can use struct fields as resolvers by using `SchemaOpt: UseFieldResolvers()`. For example,
6665
```
6766
opts := []graphql.SchemaOpt{graphql.UseFieldResolvers()}
6867
schema := graphql.MustParseSchema(s, &query{}, opts...)
69-
```
70-
71-
To tune performance, use `MaxPooledBufferCap(n)` to control buffer pooling. Buffers larger than `n` bytes won't be reused (default: 8KB). Increase this if your responses are typically large and you want to reduce allocations. Decrease it to limit memory usage in memory-constrained environments. Set to `0` to disable buffer pooling entirely.
68+
```
7269

7370
When using `UseFieldResolvers` schema option, a struct field will be used *only* when:
7471
- there is no method for a struct field
@@ -152,6 +149,7 @@ schema := graphql.MustParseSchema(sdl, &RootResolver{}, nil)
152149
- `UseFieldResolvers()` specifies whether to use struct field resolvers.
153150
- `MaxDepth(n int)` specifies the maximum field nesting depth in a query. The default is 0 which disables max depth checking.
154151
- `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.
155153
- `Tracer(tracer trace.Tracer)` is used to trace queries and fields. It defaults to `noop.Tracer`.
156154
- `Logger(logger log.Logger)` is used to log panics during query execution. It defaults to `exec.DefaultLogger`.
157155
- `PanicHandler(panicHandler errors.PanicHandler)` is used to transform panics into errors during query execution. It defaults to `errors.DefaultPanicHandler`.

0 commit comments

Comments
 (0)