Skip to content

Commit

Permalink
TinaCMS content update
Browse files Browse the repository at this point in the history
  • Loading branch information
tina-cloud-app[bot] authored Jul 15, 2024
1 parent 45d533b commit 3881c91
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions content/docs/graphql/queries/get-document.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
title: Querying a Single Document
id: /docs/graphql/queries/get-document
title: Querying a Single Document
prev: /docs/graphql/queries
next: /docs/graphql/queries/query-documents
---

## Querying a single document

Get a single document, providing it's `relativePath` as the argument.

- `relativePath` is the portion of the path _relative_ to the `collection`'s path.
* `relativePath` is the portion of the path *relative* to the `collection`'s path.

In this example, the `post` collection has a path of `content/posts` and your document can be found at `content/posts/voteForPedro.md` giving `relativePath: "voteForPedro.md"`. If your item was at `content/posts/nested-folder/voteForPedro.md` you'd specify: `relativePath: "nested-folder/voteForPedro.md"`.

Expand All @@ -26,14 +27,14 @@ In a collection, there are a few fields that are common to all documents. These
The `_sys` field is an object with the following fields:
- `filename`: The name of the file without the extension
- `basename`: The name of the file with the extension
- `path`: The full path of the file relative to the project root
- `breadcrumbs`: An array of the parent folders of the file
- `relativePath`: The path of the file relative to the collection path
- `extension`: The extension of the file
- `template`: The template of the document (or the name of the collection if not using `templates`)
- `collection`: Information about the collection
* `filename`: The name of the file without the extension
* `basename`: The name of the file with the extension
* `path`: The full path of the file relative to the project root
* `breadcrumbs`: An array of the parent folders of the file
* `relativePath`: The path of the file relative to the collection path
* `extension`: The extension of the file
* `template`: The template of the document (or the name of the collection if not using `templates`)
* `collection`: Information about the collection
### Example with a nester folder
Expand Down

0 comments on commit 3881c91

Please sign in to comment.