Skip to content

Commit 8687e2c

Browse files
committed
Revert docs for now
1 parent dade5bd commit 8687e2c

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

docs/docs/reference/graphql-data-layer/schema-customization.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ The types passed in are used to determine child relations of the node.
224224

225225
#### Defining child relations
226226

227-
The `@childOf` extension can be used to explicitly define what node types or media types a node is a child of and immediately add `child[MyType]` and `children[MyType]` fields on the parent.
227+
The `@childOf` extension can be used to explicitly define what node types or media types a node is a child of and immediately add `child[MyType]` or `children[MyType]` as a field on the parent.
228228

229229
The `types` argument takes an array of strings and determines what node types the node is a child of:
230230

@@ -255,6 +255,20 @@ type Mdx implements Node
255255
}
256256
```
257257

258+
If `many: true` is set, then instead of creating a single child field on the parent, it will create multiple:
259+
260+
```graphql
261+
# Adds `childMdx1` with type `Mdx1` to `File`.
262+
type Mdx1 implements Node @childOf(types: ["File"]) {
263+
id: ID!
264+
}
265+
266+
# Adds `childrenMdx2` with type `[Mdx2]` as a field of `File`.
267+
type Mdx2 implements Node @childOf(types: ["File"], many: true) {
268+
id: ID!
269+
}
270+
```
271+
258272
#### Nested types
259273

260274
So far, the example project has only been dealing with scalar values (`String` and `Date`;

docs/docs/schema-generation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ This allows adding GraphQL Fields to any node type. This operates on GraphQL typ
3838

3939
## 4. Parent / children relationships
4040

41-
Nodes can be connected into _child-parent_ relationships either by using [`createParentChildLink`](/docs/reference/config-files/actions/#createParentChildLink) or by adding the `parent` field to raw node data. Child types can always access parent with the `parent` field in GraphQL. Parent types also get `children` fields as well as "convenience child fields" `child[TypeName]` and `children[TypeName]`.
41+
Nodes can be connected into _child-parent_ relationships either by using [`createParentChildLink`](/docs/reference/config-files/actions/#createParentChildLink) or by adding the `parent` field to raw node data. Child types can always access parent with the `parent` field in GraphQL. Parent types also get `children` fields as well as "convenience child fields" `child[TypeName]` or `children[TypeName]`.
4242

4343
Children types are either inferred from data or created using `@childOf` directive, either by parent type name or by `mimeType` (only for File parent types).
4444

0 commit comments

Comments
 (0)