https://github.com/zoontek/swan-gql-api-ts-pattern-playground
https://github.com/zoontek/swan-gql-api-ts-pattern-playground
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zoontek/swan-gql-api-ts-pattern-playground
- Owner: zoontek
- Created: 2023-05-15T14:03:56.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-02T10:56:24.000Z (almost 3 years ago)
- Last Synced: 2025-02-23T10:24:54.237Z (over 1 year ago)
- Language: TypeScript
- Size: 123 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Swan GraphQL API + ts-pattern playground
A simple playground to generate a typed SDK for the [Swan API](https://www.swan.io) and experiment pattern matching with [`ts-pattern`](https://github.com/gvergnaud/ts-pattern).
📖 To consult the related article, follow [this link](https://www.swan.io/blog-posts/unraveling-the-magic-of-pattern-matching).
## Setup
```sh
# Clone the repository
$ git clone git@github.com:zoontek/swan-gql-api-ts-pattern-playground.git
$ cd swan-gql-api-ts-pattern-playground
# Install dependencies
$ yarn install
# Download the latest API schema
$ yarn download-schema
# Run SDK code generation
$ yarn codegen
```
Once these steps done, open your IDE and experiment in `src/index.tsx`. If you want to add / update available GQL operations, edit the `src/graphql/index.gql` file and run `yarn codegen` again.