Skip to content

Commit

Permalink
fix: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
amitksingh1490 committed Dec 5, 2024
1 parent bbfa51e commit 2e5de7b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 45 deletions.
49 changes: 25 additions & 24 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,30 +376,31 @@ The `inputs` section specifies the sources from which the GraphQL configuration
}
```

4. **Proto:**
- Specify the **path to the proto file** (`src`) to help Tailcall create a schema and understand the gRPC methods to call when a field is queried.
- Specify the **gRPC URL** (`url`) where the gRPC service is hosted.
- Include a **boolean parameter** `connectRPC` (optional). If set to `true`, the proto file will be used to generate the schema, but the communication between Tailcall and the upstream will happen using the [Connect-RPC protocol](https://connectrpc.com/docs/protocol/).

<Tabs>
<TabItem value="json" label="JSON">
```json
{
"proto": {
"src": "./path/to/file.proto",
"url": "http://127.0.0.1:8080/rpc"
}
}
```
</TabItem>
<TabItem value="yml" label="YML">
```yml
- proto:
src: "./news.proto"
url: "http://127.0.0.1:8080/rpc"
```
</TabItem>
</Tabs>
4. **Proto:**

- Specify the **path to the proto file** (`src`) to help Tailcall create a schema and understand the gRPC methods to call when a field is queried.
- Specify the **gRPC URL** (`url`) where the gRPC service is hosted.
- Include a **boolean parameter** `connectRPC` (optional). If set to `true`, the proto file will be used to generate the schema, but the communication between Tailcall and the upstream will happen using the [Connect-RPC protocol](https://connectrpc.com/docs/protocol/).

<Tabs>
<TabItem value="json" label="JSON">
```json
{
"proto": {
"src": "./path/to/file.proto",
"url": "http://127.0.0.1:8080/rpc"
}
}
```
</TabItem>
<TabItem value="yml" label="YML">
```yml
- proto:
src: "./news.proto"
url: "http://127.0.0.1:8080/rpc"
```
</TabItem>
</Tabs>

### Output

Expand Down
53 changes: 32 additions & 21 deletions docs/config-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,23 @@ Tailcall simplifies GraphQL schema generation from REST APIs, supporting various
- **format**: Specifies the output format as GraphQL (in above example, it's `graphQL`).

To generate the GraphQL configuration run following command
To generate the GraphQL configuration run following command

<Tabs>
<TabItem value="json" label="JSON Config Format">
```bash showLineNumbers
tailcall gen ./config.json
```
</TabItem>
<TabItem value="yml" label="YML Config Format">
```bash showLineNumbers
tailcall gen ./config.yml
```
</TabItem>
<TabItem value="yml" label="YML Config Format">

```bash
tailcall gen ./config.yml
```

</TabItem>
<TabItem value="json" label="JSON Config Format">

```bash
tailcall gen ./config.json
```

</TabItem>
</Tabs>
**Schema**: Specifies the name of the Query operation type, which is `Query` in this example.

Expand Down Expand Up @@ -275,9 +281,11 @@ type Query {
To generate the GraphQL configuration run following command
<Tabs>
<TabItem value="json" label="JSON Config Format">
```bash
tailcall gen ./config.json
```

```bash
tailcall gen ./config.json
```

</TabItem>
<TabItem value="yml" label="YML Config Format">
```bash
Expand All @@ -287,6 +295,7 @@ To generate the GraphQL configuration run following command
</Tabs>

Generated Configuration looks like following.

```graphql showLineNumbers title="Generated GraphQL Configuration"
schema @server @upstream {
mutation: Mutation
Expand Down Expand Up @@ -393,7 +402,6 @@ Let's understand the above configuration file.
- **url**: Specifies the url on which gRPC service is hosted. (`http://localhost:50051` in this example).
- **connectRPC**: An optional flag indicating whether Tailcall should generate [`Connect-RPC`](https://connectrpc.com/docs/protocol/) compatible configuration.


**Preset**: We've applied only one tuning parameter for the configuration. let's understand it in short.

- We've set [mergeType](config-generation.md#mergetype) to `1.0`, which basically tells config generator to merge any two GraphQL types that are exactly similar.
Expand Down Expand Up @@ -508,20 +516,23 @@ Let's understand the above configuration file.
- **format**: Specifies the output format as GraphQL (in above example, it's `graphQL`).

To generate the GraphQL configuration run following command

<Tabs>
<TabItem value="yml" label="YML Config Format">

```bash
tailcall gen ./config.yml
```

</TabItem>
<TabItem value="json" label="JSON Config Format">

```bash
tailcall gen ./config.json
```

</TabItem>
<TabItem value="yml" label="YML Config Format">
```bash
tailcall gen ./config.yml
```
</TabItem>
</Tabs>
</TabItem>
</Tabs>
**Schema**: Specifies the name of the Query operation type, which is `Query` in this example.

```graphql showLineNumbers
Expand Down

0 comments on commit 2e5de7b

Please sign in to comment.