Skip to content

Commit 2c0466b

Browse files
authored
docs: add a readme for transforms example (#427)
1 parent bfda0f7 commit 2c0466b

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

examples/transforms/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
### The Graph Client / Transforms
2+
3+
This examples indicates the use of the transforms property.
4+
5+
The graph client has some built-in transforms:
6+
7+
[Block Tracking](https://github.com/graphprotocol/graph-client#block-tracking)
8+
[Auto Pagination](https://github.com/graphprotocol/graph-client#automatic-pagination)
9+
10+
GraphQL Mesh also features more transforms which you can read about [here.](https://the-guild.dev/graphql/mesh/docs/transforms/transforms-introduction)
11+
12+
The example here is using the following tools/concepts:
13+
14+
- The Graph Client CLI for generating artifacts
15+
- GraphQL Mesh prefix transform (https://the-guild.dev/graphql/mesh/docs/transforms/prefix)
16+
- GraphQL Codegen for type safe SDK
17+
18+
### Getting Started
19+
20+
To run this example, make sure to install the dependencies in the root of the monorepo, and then run this example:
21+
22+
```
23+
# In the root directory
24+
$ yarn install
25+
$ yarn build
26+
$ cd examples/transforms/
27+
$ yarn start
28+
```
29+
30+
### Building
31+
32+
You can also build the client sdk by running: `yarn build`.
33+
34+
### GraphQL Mesh Transforms Usage
35+
36+
To run any transforms on your project from graphql mesh you will need to install the transforms respective dependency. For eg. in this project the prefix transform is used which requires the `@graphql-mesh/transform-prefix` dependency.
37+
38+
Install it by running:
39+
40+
With npm
41+
42+
```
43+
npm i -D @graphql-mesh/transform-prefix
44+
```
45+
46+
With yarn
47+
48+
```
49+
yarn add -D @graphql-mesh/transform-prefix
50+
```
51+
52+
With pnpm
53+
54+
```
55+
pnpm add -D @graphql-mesh/transform-prefix
56+
```

examples/transforms/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
"private": true,
44
"version": "0.0.5",
55
"scripts": {
6+
"build": "graphclient build",
67
"start": "graphclient serve-dev"
78
},
89
"dependencies": {
910
"@graphprotocol/client-cli": "2.2.20",
11+
"@graphql-mesh/transform-prefix": "0.12.23",
1012
"graphql": "16.6.0"
1113
}
1214
}

0 commit comments

Comments
 (0)