Skip to content
This repository was archived by the owner on Dec 25, 2025. It is now read-only.

Commit 26d7e59

Browse files
committed
Added how-it-works page
1 parent 50cac71 commit 26d7e59

6 files changed

Lines changed: 37 additions & 7 deletions

File tree

astro.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ const starlightOptions = starlight({
3535
{
3636
label: "Getting Started",
3737
items: [
38+
{
39+
label: "How it works",
40+
slug: "guides/how-it-works",
41+
},
3842
{
3943
label: "Setup",
4044
slug: "guides/setup",

src/assets/image-collection.png

293 KB
Loading

src/assets/image-form.png

258 KB
Loading

src/assets/image-single.png

214 KB
Loading
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ const Characters = () => {
2525
}
2626
```
2727

28-
Fabrix can also automatically generate forms from GraphQL mutations. The fields in the form are derived from the input types specified in the mutation variables. This allows you to quickly create and render forms based on your GraphQL schema without manually defining each form field.
29-
3028
### Query
3129

3230
```tsx
@@ -51,11 +49,7 @@ const Characters = () => {
5149
}
5250
```
5351

54-
### Mutation
55-
56-
When you provide a mutation to Fabrix, it inspects the input types of the mutation to determine the fields that should be included in the form.
57-
58-
Here’s an example of how you can use Fabrix to render a form from a mutation:
52+
## Mutation
5953

6054
```tsx
6155
import { FabrixComponent } from "@fabrix-framework/fabrix";
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: How it works
3+
description: How it works
4+
---
5+
import { Image } from 'astro:assets';
6+
import SingleQueryImage from "../../../assets/image-single.png"
7+
import CollectionQueryImage from "../../../assets/image-collection.png"
8+
import FormImage from "../../../assets/image-form.png"
9+
10+
This page describes the mechanism of Fabrix.
11+
12+
### Query (single)
13+
14+
The most basic component that Fabrix can render is a component that is rendered from a single value query. This component is rendered from a query that returns a single value.
15+
16+
The query is executed when the component is mounted and the result is rendered as simple rows.
17+
18+
<Image src={SingleQueryImage} alt="a component that is rendered from a single value query" />
19+
20+
### Query (collection)
21+
22+
When the query has the collection type, Fabrix looks into the part of the query that returns the collection and renders a component for each item in the collection.
23+
24+
<Image src={CollectionQueryImage} alt="a component that is rendered from a collection query" />
25+
26+
### Mutation
27+
28+
Fabrix can also automatically generate forms from GraphQL mutations.
29+
30+
The fields in the form are derived from the input types specified in the mutation variables. This allows you to quickly create and render forms based on your GraphQL schema without manually defining each form field.
31+
32+
<Image src={FormImage} alt="a component that is rendered from a mutation" />

0 commit comments

Comments
 (0)