Skip to content

Commit

Permalink
Switch node definition language to TS and update some text (#25632)
Browse files Browse the repository at this point in the history
  • Loading branch information
tesseralis authored Jul 17, 2020
1 parent 431c9bb commit cb282f5
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions docs/docs/node-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,23 @@ Gatsby is modeled using nodes.

The basic node data structure is as follows:

```flow
id: String,
children: Array[String],
parent: String,
fields: Object,
internal: {
contentDigest: String,
mediaType: String,
type: String,
owner: String,
fieldOwners: Object,
content: String,
```ts
interface Node {
id: string
children?: Array<string>
parent?: string
fields: object
internal: {
contentDigest: string
mediaType?: string
type: string
owner: string
fieldOwners: object
content?: string
description?: string
}
[key: string]: unknown // ...other fields specific to this type of node
}
...other fields specific to this type of node
```

### `parent`
Expand Down Expand Up @@ -55,6 +58,10 @@ Stores which plugins created which fields. This field is added by gatsby itself

Optional field exposing the raw content for this node that transformer plugins can take and further process.

### `description`

Text description of the node.

## Source plugins

New nodes are added to Gatsby by "source" plugins. A common one that many Gatsby
Expand Down

0 comments on commit cb282f5

Please sign in to comment.