Skip to content

Commit 9b9a2bb

Browse files
committed
remove all free reference
1 parent a4c090f commit 9b9a2bb

File tree

103 files changed

+4576
-1718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+4576
-1718
lines changed

guides/balance-snapshots.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ In this guide you will learn how to use [Airstack](https://airstack.xyz) to:
6060

6161
## Pre-requisites
6262

63-
- An [Airstack](https://airstack.xyz/) account (free)
63+
- An [Airstack](https://airstack.xyz/) account
6464
- Basic knowledge of GraphQL
6565

6666
## Get Started

guides/basics/generate-typescript-interfaces.md

+51-26
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ layout:
2121

2222
In this guide you will learn how to:
2323

24-
* [Step 1: Install Packages](generate-typescript-interfaces.md#step-1-install-packages)
25-
* [Step 2: Create `codegen.ts`](generate-typescript-interfaces.md#step-2-create-codegen.ts)
26-
* [Step 3: Modify `package.json` Scripts](generate-typescript-interfaces.md#step-3-modify-package.json-scripts)
27-
* [Step 4: Mark All GraphQL Queries](generate-typescript-interfaces.md#step-4-mark-all-graphql-queries)
28-
* [Step 5: Generate TypeScript Interfaces](generate-typescript-interfaces.md#step-5-generate-typescript-interfaces)
24+
- [Step 1: Install Packages](generate-typescript-interfaces.md#step-1-install-packages)
25+
- [Step 2: Create `codegen.ts`](generate-typescript-interfaces.md#step-2-create-codegen.ts)
26+
- [Step 3: Modify `package.json` Scripts](generate-typescript-interfaces.md#step-3-modify-package.json-scripts)
27+
- [Step 4: Mark All GraphQL Queries](generate-typescript-interfaces.md#step-4-mark-all-graphql-queries)
28+
- [Step 5: Generate TypeScript Interfaces](generate-typescript-interfaces.md#step-5-generate-typescript-interfaces)
2929

3030
## Pre-requisites
3131

32-
* An [Airstack](https://airstack.xyz/) account (free)
33-
* Basic knowledge of GraphQL
32+
- An [Airstack](https://airstack.xyz/) account
33+
- Basic knowledge of GraphQL
3434

3535
## Step 1: Install Packages
3636

@@ -39,25 +39,31 @@ First, you need to install the required packages using your favorite package man
3939
{% tabs %}
4040
{% tab title="npm" %}
4141
{% code overflow="wrap" %}
42+
4243
```bash
4344
npm install --save-dev @graphql-codegen/cli @graphql-codegen/typescript @graphql-codegen/typescript-operations @parcel/watcher
4445
```
46+
4547
{% endcode %}
4648
{% endtab %}
4749

4850
{% tab title="yarn" %}
4951
{% code overflow="wrap" %}
52+
5053
```bash
5154
yarn add --dev @graphql-codegen/cli @graphql-codegen/typescript @graphql-codegen/typescript-operations @parcel/watcher
5255
```
56+
5357
{% endcode %}
5458
{% endtab %}
5559

5660
{% tab title="pnpm" %}
5761
{% code overflow="wrap" %}
62+
5863
```bash
5964
pnpm install --dev @graphql-codegen/cli @graphql-codegen/typescript @graphql-codegen/typescript-operations @parcel/watcher
6065
```
66+
6167
{% endcode %}
6268
{% endtab %}
6369
{% endtabs %}
@@ -97,17 +103,19 @@ Here, the types will be compiled and outputted in a single file `src/graphql/typ
97103
Once you have the `codegen.ts` file ready, add the following scripts to your project's `package.json`:
98104

99105
{% code title="package.json" %}
106+
100107
```json
101108
{
102109
"scripts": {
103110
"generate": "npx graphql-codegen",
104111
"prestart": "yarn generate",
105-
"predev": "yarn generate",
112+
"predev": "yarn generate"
106113
// Other scripts
107-
},
114+
}
108115
// ...
109116
}
110117
```
118+
111119
{% endcode %}
112120

113121
Here, you'll have 3 new scripts:
@@ -123,7 +131,7 @@ Optionally, you can also run the `generate` script concurrently in **watch mode*
123131
"scripts": {
124132
"dev": "concurrently \"vite\" \"yarn generate --watch\""
125133
// Other scripts
126-
},
134+
}
127135
// ...
128136
}
129137
```
@@ -139,9 +147,9 @@ Keep in mind to have the name of each query **UNIQUE** to each other as TypeScri
139147

140148
For example, the query below has name `FetchWeb3Identity`. Therefore, the types generated will be:
141149

142-
* `FetchWeb3IdentityQuery`: response data type interface
143-
* `FetchWeb3IdentityVariables`: variable type interface
144-
{% endhint %}
150+
- `FetchWeb3IdentityQuery`: response data type interface
151+
- `FetchWeb3IdentityVariables`: variable type interface
152+
{% endhint %}
145153

146154
```typescript
147155
const query = /* GraphQL */ `
@@ -163,21 +171,27 @@ Finally, you can run the `generate` scripts to generate the necessary typescript
163171

164172
{% tabs %}
165173
{% tab title="npm" %}
174+
166175
```bash
167176
npm run generate
168177
```
178+
169179
{% endtab %}
170180

171181
{% tab title="yarn" %}
182+
172183
```bash
173184
yarn generate
174185
```
186+
175187
{% endtab %}
176188

177189
{% tab title="pnpm" %}
190+
178191
```bash
179192
pnpm run generate
180193
```
194+
181195
{% endtab %}
182196
{% endtabs %}
183197

@@ -187,6 +201,7 @@ From `src/graphql/types.ts`, you can import all the necessary types for your Air
187201

188202
{% tabs %}
189203
{% tab title="Vanilla (TS)" %}
204+
190205
```typescript
191206
import { fetchQuery } from "@airstack/airstack-react";
192207
import { FetchWeb3IdentityQuery } from "./src/graphql/types";
@@ -197,21 +212,28 @@ const { data, loading, error } = fetchQuery<FetchWeb3IdentityQuery>(
197212
{ cache: false }
198213
);
199214
```
215+
200216
{% endtab %}
201217

202218
{% tab title="React (TS)" %}
219+
203220
```tsx
204221
import { useQuery } from "@airstack/airstack-react";
205-
import { FetchWeb3IdentityQuery, FetchWeb3IdentityVariables } from "./src/graphql/types";
222+
import {
223+
FetchWeb3IdentityQuery,
224+
FetchWeb3IdentityVariables,
225+
} from "./src/graphql/types";
206226

207227
const { data, loading, error } = useQuery<
208228
FetchWeb3IdentityQuery,
209229
FetchWeb3IdentityVariables
210230
>(query, {}, { cache: false });
211231
```
232+
212233
{% endtab %}
213234

214235
{% tab title="Node (TS)" %}
236+
215237
```typescript
216238
import { fetchQuery } from "@airstack/node";
217239
import { FetchWeb3IdentityQuery } from "./src/graphql/types";
@@ -225,46 +247,49 @@ interface Error {
225247
message: string;
226248
}
227249

228-
const { data, error }: QueryResponse = fetchQuery(
229-
query,
230-
{},
231-
{ cache: false }
232-
);
250+
const { data, error }: QueryResponse = fetchQuery(query, {}, { cache: false });
233251
```
252+
234253
{% endtab %}
235254
{% endtabs %}
236255

237256
Alternatively, if you added **watch** mode to run concurrently with your development or production build script, you can simply run those scripts and the types will be generated upon development or build time.
238257

239258
{% tabs %}
240259
{% tab title="npm" %}
260+
241261
```bash
242262
# For development
243263
npm run dev
244264

245265
# For production build
246266
npm run build
247267
```
268+
248269
{% endtab %}
249270

250271
{% tab title="yarn" %}
272+
251273
```bash
252274
# For development
253275
yarn dev
254276

255277
# For production build
256278
yarn build
257279
```
280+
258281
{% endtab %}
259282

260283
{% tab title="pnpm" %}
284+
261285
```bash
262286
# For development
263287
pnpm run dev
264288

265289
# For production build
266290
pnpm run build
267291
```
292+
268293
{% endtab %}
269294
{% endtabs %}
270295

@@ -274,10 +299,10 @@ If you have any questions or need help regarding generating TypeScript interface
274299

275300
### More Resources
276301

277-
* [API Overview](../../api-references/overview/)
278-
* [API References](../../api-references/api-reference/)
279-
* [Variables](../../web-sdk-reference/objects/variables.md)
280-
* [Pagination](pagination-in-airstack-sdk.md)
281-
* [Direct API Call](../../get-started/quickstart/direct-api-call.md)
282-
* [Multiple Queries Execution](multiple-queries-execution.md)
283-
* [Cross Chain Queries](cross-chain-queries.md)
302+
- [API Overview](../../api-references/overview/)
303+
- [API References](../../api-references/api-reference/)
304+
- [Variables](../../web-sdk-reference/objects/variables.md)
305+
- [Pagination](pagination-in-airstack-sdk.md)
306+
- [Direct API Call](../../get-started/quickstart/direct-api-call.md)
307+
- [Multiple Queries Execution](multiple-queries-execution.md)
308+
- [Cross Chain Queries](cross-chain-queries.md)

0 commit comments

Comments
 (0)