Skip to content

Commit

Permalink
drop json/yaml configuration support
Browse files Browse the repository at this point in the history
  • Loading branch information
meskill committed Dec 9, 2024
1 parent b51bf80 commit c58e943
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 597 deletions.
2 changes: 1 addition & 1 deletion blog/tailcall-n+1-working-2024-08-04.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ It's simple, expressive and doesn't expose the guts of how data will be queried,

## The Algorithm

Tailcall reads your [configuration](/docs/tailcall-graphql-configuration-format-conversion), parses it, and internally stores it in an efficient graph data-structure that resembles a `HashMap`. This allows `O(1)` access to a GraphQL type which represented as a node by its name. Once the graph data-structure is ready we make it go through a series of validators, one of them being the **N+1 tracker**.
Tailcall reads your configuration, parses it, and internally stores it in an efficient graph data-structure that resembles a `HashMap`. This allows `O(1)` access to a GraphQL type which represented as a node by its name. Once the graph data-structure is ready we make it go through a series of validators, one of them being the **N+1 tracker**.

Now, here's where it gets fascinating. We use a Depth-First Search (DFS) algorithm, starting at the root query and traversing all the connected nodes. Let me walk you through this cool process:

Expand Down
2 changes: 1 addition & 1 deletion docs/apollo-federation-subgraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Skip this step if you don't have entities for now or want to add them later.

Now you need to add [entity resolvers](https://www.apollographql.com/docs/federation/entities/) to the Tailcall config to make it act as a subgraph.

To do this, you need to define resolver on types by using one of the [directives](./configuration.mdx) that resolve the data. Use [`{{.value}}`](https://tailcall.run/docs/graphql-resolver-context-tailcall/#value) to access the fields that act as a federation `@key` and will be provided by the Federation Router when making the request to this subgraph.
To do this, you need to define resolver on types by using one of the [directives](./directives.md) that resolve the data. Use [`{{.value}}`](https://tailcall.run/docs/graphql-resolver-context-tailcall/#value) to access the fields that act as a federation `@key` and will be provided by the Federation Router when making the request to this subgraph.

```graphql
type Post
Expand Down
35 changes: 12 additions & 23 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ The `check` command allows for files. Specify each file path, separated by a spa
tailcall check --schema ./path/to/file1.graphql ./path/to/file2.graphql
```

### --format

This is an optional command which allows changing the format of the input file. It accepts `gql` or `graphql`,`yml` or `yaml`, `json` .

```bash
tailcall check ./path/to/file1.graphql ./path/to/file2.graphql --format json
```

### --verify-ssl

Controls SSL/TLS certificate verification when loading remote configuration files.
Expand Down Expand Up @@ -119,13 +111,17 @@ tailcall init <file_path>

This command prompts for file creation and configuration, creating the following files:

| File Name | Description |
| ------------------------: | --------------------------------------------------------------------------------------------------------------------------------------- |
| [.tailcallrc.schema.json] | Provides autocomplete in your editor when the configuration is written in `json` or `yml` format. |
| [.graphqlrc.yml] | An IDE configuration that references your GraphQL configuration (if it's in `.graphql` format) and the following `.tailcallrc.graphql`. |
| [.tailcallrc.graphql] | Contains Tailcall specific auto-completions for `.graphql` format. |
| File Name | Description |
| --------: | ----------- |

<!-- TODO: uncomment when the Taillcall configuration will in separate file -->
<!-- | [.tailcallrc.schema.json] | Provides autocomplete in your editor for the tailcall configuration written in `json` or `yml` format. | -->

| [.graphqlrc.yml] | An IDE configuration that references your GraphQL schema and the following `.tailcallrc.graphql`. |
| [.tailcallrc.graphql] | Contains Tailcall specific auto-completions for `.graphql` format. |

<!-- [.tailcallrc.schema.json]: https://github.com/tailcallhq/tailcall/blob/main/generated/.tailcallrc.schema.json -->

[.tailcallrc.schema.json]: https://github.com/tailcallhq/tailcall/blob/main/generated/.tailcallrc.schema.json
[.graphqlrc.yml]: https://the-guild.dev/graphql/config/docs
[.tailcallrc.graphql]: https://github.com/tailcallhq/tailcall/blob/main/generated/.tailcallrc.graphql

Expand Down Expand Up @@ -187,8 +183,7 @@ To generate a Tailcall GraphQL configuration, provide a configuration file to th
}
],
"output": {
"path": "./output.graphql",
"format": "graphQL"
"path": "./output.graphql"
},
"schema": {
"query": "Query",
Expand Down Expand Up @@ -236,7 +231,6 @@ inputs:
url: "http://127.0.0.1:8080/rpc"
output:
path: "./output.graphql"
format: "graphQL"
schema:
query: "Query"
mutation: "Mutation"
Expand Down Expand Up @@ -404,14 +398,9 @@ The `inputs` section specifies the sources from which the GraphQL configuration

### Output

The `output` section specifies the path and format for the generated GraphQL configuration.
The `output` section specifies the path for the generated GraphQL configuration.

- **path**: The file path where the output will be saved.
- **format**: The format of the output file. Supported formats are `json`, `yml`, and `graphQL`.

:::tip
You can also change the format of the configuration later using the [check](#--format) command.
:::

### Preset

Expand Down
Loading

0 comments on commit c58e943

Please sign in to comment.