Skip to content

Commit a52a5b2

Browse files
committed
Undocumented map for now (highly likely that it will be reverted)
1 parent 7f70292 commit a52a5b2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,10 @@ Option | Type | Notes
278278
name | `string` | Required. Name of the field. If not set - GraphQL will look use `key` of fields array on type definition.
279279
type | `Type` or `callback() => Type` | Required. One of internal or custom types. Alternatively - callback that returns `type`.
280280
args | `array` | Array of possible type arguments. Each entry is expected to be an array with following keys: **name** (`string`), **type** (`Type` or `callback() => Type`), **defaultValue** (`any`)
281-
resolve | `callback($value, $args, ResolveInfo $info) => $fieldValue` | Function that receives `$value` of parent type and returns value for this field. Mutually exclusive with `map`
282-
map | `callback($listOfValues, $args, ResolveInfo $info) => $fieldValues[]` | Function that receives list of parent type values and maps them to list of field values. Mutually exclusive with `resolve`
281+
resolve | `callback($value, $args, ResolveInfo $info) => $fieldValue` | Function that receives `$value` of parent type and returns value for this field.
283282
description | `string` | Field description for clients
284283
deprecationReason | `string` | Text describing why this field is deprecated. When not empty - field will not be returned by introspection queries (unless forced)
285284

286-
Use `map` or `resolve` for custom data fetching logic. `resolve` is easier to use, but `map` allows batching of queries to backend storage (for example you can use Redis MGET or IN(?) for SQL queries).
287-
288285

289286
### Schema
290287
After all of your types are defined, you must define schema. Schema consists of two special root-level types: `Query` and `Mutation`

0 commit comments

Comments
 (0)