Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Fix doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deekerno committed Aug 30, 2023
1 parent 2fe28ef commit e64f92b
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 79 deletions.
10 changes: 5 additions & 5 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
- [Relationships](./graphql/relationships.md)
- [API Server](./graphql/api-server.md)
- [Playground](./graphql/playground.md)
- [Queries](./graphql/queries/index.md)
- [Search and Filtering](./graphql/queries/search-filtering.md)
- [Pagination](./graphql/queries/pagination.md)
- [A Full Example](./graphql/queries/full-example.md)
- [Basic Queries](./graphql/queries.md)
- [Search and Filtering](./graphql/search-filtering.md)
- [Pagination](./graphql/pagination.md)
- [A Full Example](./graphql/full-example.md)
- [Storing Info in a Database](./database/index.md)
- [forc index](./forc-index/index.md)
- [new](./forc-index/new.md)
Expand All @@ -57,7 +57,7 @@
- [start](./forc-postgres/start.md)
- [stop](./forc-postgres/stop.md)
- [drop](./forc-postgres/drop.md)
- [Authentication](./authentication/index.md) -->
- [Authentication](./authentication/index.md)

# For Contributors

Expand Down
2 changes: 1 addition & 1 deletion docs/src/database/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The Fuel indexer uses [PostgreSQL](https://github.com/docker-library/postgres/bl
Below is a mapping of GraphQL schema types to their Sway and database equivalents. Note that an empty cell denotes that there is no direct equivalent for the type in the corresponding domain.

| GraphQL Scalar | Sway Type | Postgres Type |
--- | --- | ---
--- | --- | ---
| Address | `b256` | varchar(64) |
| AssetId | `u8[32]` | varchar(64) |
| Blob | `str[]` | varchar(10485760) |
Expand Down
60 changes: 0 additions & 60 deletions docs/src/database/types.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/src/getting-started/starting-the-fuel-indexer.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The Fuel indexer service will connect to any Fuel node, which means you can run
| Indexer Service Web API | localhost | 29987 | `--web-api-host` / `--web-api-port` | |

## Starting the Fuel indexer

### Using CLI options

```text
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/src/graphql/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The Fuel indexer uses GraphQL to in order to allow users to query for indexed da
- [Directives](./directives.md)
- [GraphQL API Server](./api-server.md)
- [Playground](./playground.md)
- [Queries](../queries/index.md)
- [Queries](./queries.md)

## Supported Functionality

Expand All @@ -19,12 +19,12 @@ While we do our best to maintain compliance with the GraphQL specification and p

| Functionality | Status | Notes |
|------|----------|-------|
| Arguments || [read the Search and Filtering section](../queries/search-filtering.md) |
| Arguments || [read the Search and Filtering section](./search-filtering.md) |
| Aliases || |
| Fragments || inline fragments are currently not supported |
| Introspection || |
| GraphQL Playground || [read the Playground section](./playground.md) |
| Pagination || [read the Pagination section](../queries/pagination.md) |
| Pagination || [read the Pagination section](./pagination.md) |
| Directives | 🚧 | [read the Directives section](./directives.md) |
| List Types | 🚧 | |
| Union Types | 🚧 | |
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Queries

Once data has been persisted into your storage backend, you can retrieve it by querying the [GraphQL API server](../graphql/api-server.md). By default, the API server can be reached at `http://localhost:29987/api/graph/:namespace/:identifier`, where `:namespace` and `:identifier` are the values for the respective fields in your indexer's manifest. If you've changed the `WEB_API_HOST` or `WEB_API_PORT` values of your configuration, then you'll need to adjust the URL accordingly.
Once data has been persisted into your storage backend, you can retrieve it by querying the [GraphQL API server](./api-server.md). By default, the API server can be reached at `http://localhost:29987/api/graph/:namespace/:identifier`, where `:namespace` and `:identifier` are the values for the respective fields in your indexer's manifest. If you've changed the `WEB_API_HOST` or `WEB_API_PORT` values of your configuration, then you'll need to adjust the URL accordingly.

## Basic Query

Expand Down Expand Up @@ -63,7 +63,7 @@ We're requesting the ID, height, and timestamp for each block stored in the back

## Nested Query

The Fuel indexer supports [foreign keys](../database/foreign-keys.md) on entity types; thus, you can also ask for information about a referenced entity inside of your query. A nested query has the following general structure:
The Fuel indexer supports [foreign keys](./relationships.md) on entity types; thus, you can also ask for information about a referenced entity inside of your query. A nested query has the following general structure:

```graphql
query {
Expand Down Expand Up @@ -112,7 +112,7 @@ type Character @entity {
}
```

This schema uses implicit foreign keys to reference other entities; for more information on implicit and explicit foreign keys, please refer to the [Foreign Keys](../database/foreign-keys.md) section of the book. In this contrived example, we're storing information about characters that are found in books which are stored in libraries that can be found in cities. This will be the query that we use to retrieve the aforementioned data:
This schema uses implicit foreign keys to reference other entities; for more information on implicit and explicit foreign keys, please refer to the [Relationships](./relationships.md) section of the book. In this contrived example, we're storing information about characters that are found in books which are stored in libraries that can be found in cities. This will be the query that we use to retrieve the aforementioned data:

```graphql
query {
Expand Down
4 changes: 0 additions & 4 deletions docs/src/graphql/relationships.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ type Library @entity {
}
```

#### Implicit foreign keys

Given the above schema, two entities will be created: a `Book` entity, and a `Library` entity. As you can see, we add the `Book` entity as an attribute on the `Library` entity, thus conveying that we want a one-to-many or one-to-one relationship between `Library` and `Book`. This means that for a given `Library`, we may also fetch one or many `Book` entities. It also means that the column `library.book` will be an integer type that references `book.id`.

### Explicit foreign keys
Expand All @@ -46,6 +44,4 @@ type Library @entity {
}
```

#### Explicit foreign keys

For the most part, this works the same way as implicit foreign key usage. However, as you can see, instead of implicitly using `book.id` as the reference column for our `Book` object, we're _explicitly_ specifying that we want `book.name` to serve as our foreign key. Also, please note that since we're using `book.name` in our foreign key constraint, that column is required to be unique (via the `@unique` directive).
2 changes: 1 addition & 1 deletion docs/src/graphql/scalars.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The Fuel indexer has a collection of GraphQL scalars that cover virtually any value type in use on the Fuel network. The following list contains each GraphQL scalar type along with its equivalent Rust type.

| GraphQL Scalar | Rust Type | Notes |
--- | --- | ---
--- | --- | ---
| Address | `u8[32]` |
| AssetId | `u8[32]` |
| Blob | `Vec<u8>` | Byte blob of arbitary size |
Expand Down
2 changes: 1 addition & 1 deletion docs/src/project-components/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ We'll describe these three different implementations below.

### As tooling for compiling indexers

The Fuel indexer provides functionality to make it easy to build and compile abitrary indexers by using [`forc index`](../forc-index/index.md). For info on how to use indexer tooling to compile arbitrary indexers, check out our [Quickstart](../getting-started/quickstart.md) and [Hello World](../getting-started/hello-world.md) examples for a more in-depth exploration of how to compile indexers.
The Fuel indexer provides functionality to make it easy to build and compile abitrary indexers by using [`forc index`](../forc-index/index.md). For info on how to use indexer tooling to compile arbitrary indexers, check out our [Quickstart](../getting-started/quickstart.md) example for a more in-depth exploration of how to compile indexers.

### As a standalone service

Expand Down
2 changes: 1 addition & 1 deletion docs/src/project-components/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type SecondThing @entity {
```

The types you see above (e.g., `ID`, `UInt8`, etc) are Fuel abstractions that were created to more seamlessly integrate with the Fuel VM and are not native to GraphQL. A deeper explanation on these
types can be found in [the Types section](../data-types/types.md).
types can be found in [the Types section](../database/index.md).

> Important: It is up to developers to manage their own unique IDs for each type, meaning that a data structure's `ID` field needs to be manually generated prior to saving it to the database. This generation can be as simple or complex as you want in order to fit your particular situation; the only requirement is that the developer implement their own custom generation.

Expand Down

0 comments on commit e64f92b

Please sign in to comment.