Skip to content

Commit 8c748cc

Browse files
authored
Update SDK Documentation (#69)
1 parent f206ca0 commit 8c748cc

3 files changed

Lines changed: 281 additions & 0 deletions

File tree

src/reference/sdks/backend/index.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ The SDK for the Events service.
5050
5151
The SDK for the Findings service.
5252

53+
##### graphql
54+
55+
> **graphql**: [`GraphQLSDK`](index.md#graphqlsdk)
56+
57+
The SDK for the GraphQL service.
58+
5359
##### meta
5460

5561
> **meta**: [`MetaSDK`](index.md#metasdk)
@@ -2496,6 +2502,47 @@ false
24962502
24972503
Value of the environment variable
24982504

2505+
## GraphQL
2506+
2507+
### GraphQLSDK
2508+
2509+
> **GraphQLSDK**: `object`
2510+
2511+
The SDK for the GraphQL service.
2512+
2513+
#### Type declaration
2514+
2515+
##### execute()
2516+
2517+
Executes a GraphQL query.
2518+
2519+
###### Type Parameters
2520+
2521+
| Type Parameter |
2522+
| ------ |
2523+
| `T` |
2524+
2525+
###### Parameters
2526+
2527+
| Parameter | Type |
2528+
| ------ | ------ |
2529+
| `query` | `string` |
2530+
| `variables`? | `Record`\<`string`, `any`\> |
2531+
2532+
###### Returns
2533+
2534+
`Promise`\<[`GraphQLResponse`](index.md#graphqlresponset)\<`T`\>\>
2535+
2536+
###### Example
2537+
2538+
```js
2539+
await sdk.graphql.execute(`
2540+
query {
2541+
viewer
2542+
}
2543+
`);
2544+
```
2545+
24992546
## Other
25002547

25012548
### Database
@@ -2720,6 +2767,74 @@ Usually used for unexpected behaviors.
27202767

27212768
***
27222769

2770+
### GraphQLError
2771+
2772+
> **GraphQLError**: `object`
2773+
2774+
#### Type declaration
2775+
2776+
##### extensions
2777+
2778+
> **extensions**: `Record`\<`string`, `any`\>
2779+
2780+
##### locations
2781+
2782+
> **locations**: [`GraphQLLocation`](index.md#graphqllocation)[]
2783+
2784+
##### message
2785+
2786+
> **message**: `string`
2787+
2788+
##### path
2789+
2790+
> **path**: [`GraphQLPathSegment`](index.md#graphqlpathsegment)[]
2791+
2792+
***
2793+
2794+
### GraphQLLocation
2795+
2796+
> **GraphQLLocation**: `object`
2797+
2798+
#### Type declaration
2799+
2800+
##### column
2801+
2802+
> **column**: `number`
2803+
2804+
##### line
2805+
2806+
> **line**: `number`
2807+
2808+
***
2809+
2810+
### GraphQLPathSegment
2811+
2812+
> **GraphQLPathSegment**: `string` \| `number`
2813+
2814+
***
2815+
2816+
### GraphQLResponse\<T\>
2817+
2818+
> **GraphQLResponse**\<`T`\>: `object`
2819+
2820+
#### Type Parameters
2821+
2822+
| Type Parameter |
2823+
| ------ |
2824+
| `T` |
2825+
2826+
#### Type declaration
2827+
2828+
##### data?
2829+
2830+
> `optional` **data**: `T`
2831+
2832+
##### errors?
2833+
2834+
> `optional` **errors**: [`GraphQLError`](index.md#graphqlerror)[]
2835+
2836+
***
2837+
27232838
### PageInfo
27242839

27252840
> **PageInfo**: `object`

src/reference/sdks/frontend/index.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,23 @@ Create a new collection.
13751375

13761376
`Promise`\<[`ReplayCollection`](index.md#replaycollection)\>
13771377

1378+
##### createSession()
1379+
1380+
> **createSession**: (`source`: [`RequestSource`](index.md#requestsource), `collectionId`?: [`ID`](index.md#id-3)) => `Promise`\<`void`\>
1381+
1382+
Create a session.
1383+
1384+
###### Parameters
1385+
1386+
| Parameter | Type | Description |
1387+
| ------ | ------ | ------ |
1388+
| `source` | [`RequestSource`](index.md#requestsource) | - |
1389+
| `collectionId`? | [`ID`](index.md#id-3) | The ID of the collection to add the request. |
1390+
1391+
###### Returns
1392+
1393+
`Promise`\<`void`\>
1394+
13781395
##### deleteCollection()
13791396

13801397
> **deleteCollection**: (`id`: [`ID`](index.md#id-3)) => `Promise`\<`boolean`\>
@@ -1597,6 +1614,34 @@ The ID of the session associated with this tab.
15971614

15981615
***
15991616

1617+
### RequestSource
1618+
1619+
> **RequestSource**: \{ `connectionInfo`: [`SendRequestOptions`](index.md#sendrequestoptions)\[`"connectionInfo"`\]; `raw`: `string`; `type`: `"Raw"`; \} \| \{ `id`: `string`; `type`: `"ID"`; \}
1620+
1621+
#### Remarks
1622+
1623+
This type is a discriminated union with two possible shapes:
1624+
- A raw request, containing the raw HTTP request string and connection information.
1625+
- A reference to an existing request ID.
1626+
1627+
#### Example
1628+
1629+
```ts
1630+
// Using a raw request
1631+
const source: RequestSource = {
1632+
type: "Raw",
1633+
raw: "GET /api/data HTTP/1.1",
1634+
connectionInfo: { ... }
1635+
};
1636+
// Using an ID
1637+
const source: RequestSource = {
1638+
type: "ID",
1639+
id: "request-123"
1640+
};
1641+
```
1642+
1643+
***
1644+
16001645
### SendRequestOptions
16011646

16021647
> **SendRequestOptions**: `object`
@@ -2068,6 +2113,12 @@ The path of the file.
20682113
20692114
The size of the file in bytes.
20702115

2116+
##### status
2117+
2118+
> **status**: `"ready"` \| `"error"`
2119+
2120+
The status of the file.
2121+
20712122
##### updatedAt
20722123

20732124
> **updatedAt**: `Date`

src/reference/sdks/workflow/index.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ The SDK for the Environment service.
3333
3434
The SDK for the Findings service.
3535

36+
##### graphql
37+
38+
> **graphql**: [`GraphQLSDK`](index.md#graphqlsdk)
39+
40+
The SDK for the GraphQL service.
41+
3642
##### projects
3743

3844
> **projects**: [`ProjectsSDK`](index.md#projectssdk)
@@ -2234,6 +2240,47 @@ false
22342240
22352241
Value of the environment variable
22362242

2243+
## GraphQL
2244+
2245+
### GraphQLSDK
2246+
2247+
> **GraphQLSDK**: `object`
2248+
2249+
The SDK for the GraphQL service.
2250+
2251+
#### Type declaration
2252+
2253+
##### execute()
2254+
2255+
Executes a GraphQL query.
2256+
2257+
###### Type Parameters
2258+
2259+
| Type Parameter |
2260+
| ------ |
2261+
| `T` |
2262+
2263+
###### Parameters
2264+
2265+
| Parameter | Type |
2266+
| ------ | ------ |
2267+
| `query` | `string` |
2268+
| `variables`? | `Record`\<`string`, `any`\> |
2269+
2270+
###### Returns
2271+
2272+
`Promise`\<[`GraphQLResponse`](index.md#graphqlresponset)\<`T`\>\>
2273+
2274+
###### Example
2275+
2276+
```js
2277+
await sdk.graphql.execute(`
2278+
query {
2279+
viewer
2280+
}
2281+
`);
2282+
```
2283+
22372284
## Other
22382285

22392286
### Console
@@ -2313,6 +2360,74 @@ Usually used for unexpected behaviors.
23132360

23142361
***
23152362

2363+
### GraphQLError
2364+
2365+
> **GraphQLError**: `object`
2366+
2367+
#### Type declaration
2368+
2369+
##### extensions
2370+
2371+
> **extensions**: `Record`\<`string`, `any`\>
2372+
2373+
##### locations
2374+
2375+
> **locations**: [`GraphQLLocation`](index.md#graphqllocation)[]
2376+
2377+
##### message
2378+
2379+
> **message**: `string`
2380+
2381+
##### path
2382+
2383+
> **path**: [`GraphQLPathSegment`](index.md#graphqlpathsegment)[]
2384+
2385+
***
2386+
2387+
### GraphQLLocation
2388+
2389+
> **GraphQLLocation**: `object`
2390+
2391+
#### Type declaration
2392+
2393+
##### column
2394+
2395+
> **column**: `number`
2396+
2397+
##### line
2398+
2399+
> **line**: `number`
2400+
2401+
***
2402+
2403+
### GraphQLPathSegment
2404+
2405+
> **GraphQLPathSegment**: `string` \| `number`
2406+
2407+
***
2408+
2409+
### GraphQLResponse\<T\>
2410+
2411+
> **GraphQLResponse**\<`T`\>: `object`
2412+
2413+
#### Type Parameters
2414+
2415+
| Type Parameter |
2416+
| ------ |
2417+
| `T` |
2418+
2419+
#### Type declaration
2420+
2421+
##### data?
2422+
2423+
> `optional` **data**: `T`
2424+
2425+
##### errors?
2426+
2427+
> `optional` **errors**: [`GraphQLError`](index.md#graphqlerror)[]
2428+
2429+
***
2430+
23162431
### PageInfo
23172432

23182433
> **PageInfo**: `object`

0 commit comments

Comments
 (0)