You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: e2e/data-connect/dataconnect-generated/js/default-connector/README.md
+55-27Lines changed: 55 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,25 @@
1
+
# Generated TypeScript README
2
+
This README will guide you through the process of using the generated JavaScript SDK package for the connector `default`. It will also provide examples on how to use your generated SDK to call your Data Connect queries and mutations.
3
+
4
+
***NOTE:** This README is generated alongside the generated SDK. If you make changes to this file, they will be overwritten when the SDK is regenerated.*
5
+
1
6
# Table of Contents
2
-
-[**Overview**](#generated-typescript-readme)
7
+
-[**Overview**](#generated-javascript-readme)
3
8
-[**Accessing the connector**](#accessing-the-connector)
4
9
-[*Connecting to the local Emulator*](#connecting-to-the-local-emulator)
5
10
-[**Queries**](#queries)
6
11
-[*ListMovies*](#listmovies)
7
12
-[**Mutations**](#mutations)
8
13
-[*CreateMovie*](#createmovie)
9
14
10
-
# Generated TypeScript README
11
-
This README will guide you through the process of using the generated TypeScript SDK package for the connector `default`. It will also provide examples on how to use your generated SDK to call your Data Connect queries and mutations.
12
-
13
-
***NOTE:** This README is generated alongside the generated SDK. If you make changes to this file, they will be overwritten when the SDK is regenerated.*
15
+
# Accessing the connector
16
+
A connector is a collection of Queries and Mutations. One SDK is generated for each connector - this SDK is generated for the connector `default`. You can find more information about connectors in the [Data Connect documentation](https://firebase.google.com/docs/data-connect#how-does).
14
17
15
18
You can use this generated SDK by importing from the package `@firebasegen/default-connector` as shown below. Both CommonJS and ESM imports are supported.
16
19
17
20
You can also follow the instructions from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#set-client).
18
21
19
-
# Accessing the connector
20
-
A connector is a collection of Queries and Mutations. One SDK is generated for each connector - this SDK is generated for the connector `default`.
21
-
22
-
You can find more information about connectors in the [Data Connect documentation](https://firebase.google.com/docs/data-connect#how-does).
@@ -34,7 +32,7 @@ By default, the connector will connect to the production service.
34
32
To connect to the emulator, you can use the following code.
35
33
You can also follow the emulator instructions from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#instrument-clients).
@@ -61,16 +59,31 @@ Below are examples of how to use the `default` connector's generated functions t
61
59
62
60
## ListMovies
63
61
You can execute the `ListMovies` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts):
If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the listMoviesRef:
84
+
```typescript
85
+
const name =listMoviesRef.operationName;
86
+
console.log(name);
74
87
```
75
88
76
89
### Variables
@@ -79,7 +92,7 @@ The `ListMovies` query has no variables.
79
92
Recall that executing the `ListMovies` query returns a `QueryPromise` that resolves to an object with a `data` property.
80
93
81
94
The `data` property is an object of type `ListMoviesData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields:
@@ -157,22 +170,37 @@ Below are examples of how to use the `default` connector's generated functions t
157
170
158
171
## CreateMovie
159
172
You can execute the `CreateMovie` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts):
If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the createMovieRef:
195
+
```typescript
196
+
const name =createMovieRef.operationName;
197
+
console.log(name);
170
198
```
171
199
172
200
### Variables
173
201
The `CreateMovie` mutation requires an argument of type `CreateMovieVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields:
Recall that executing the `CreateMovie` mutation returns a `MutationPromise` that resolves to an object with a `data` property.
184
212
185
213
The `data` property is an object of type `CreateMovieData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields:
186
-
```javascript
214
+
```typescript
187
215
exportinterfaceCreateMovieData {
188
216
movie_insert:Movie_Key;
189
217
}
190
218
```
191
219
### Using `CreateMovie`'s action shortcut function
0 commit comments