@@ -7,31 +7,31 @@ const connectorConfig = {
7
7
} ;
8
8
exports . connectorConfig = connectorConfig ;
9
9
10
- function listMoviesRef ( dc ) {
11
- const { dc : dcInstance } = validateArgs ( connectorConfig , dc , undefined ) ;
10
+ function createMovieRef ( dcOrVars , vars ) {
11
+ const { dc : dcInstance , vars : inputVars } = validateArgs ( connectorConfig , dcOrVars , vars , true ) ;
12
12
if ( '_useGeneratedSdk' in dcInstance ) {
13
13
dcInstance . _useGeneratedSdk ( ) ;
14
14
} else {
15
15
console . error ( 'Please update to the latest version of the Data Connect SDK by running `npm install firebase@dataconnect-preview`.' ) ;
16
16
}
17
- return queryRef ( dcInstance , 'ListMovies' ) ;
17
+ return mutationRef ( dcInstance , 'CreateMovie' , inputVars ) ;
18
18
}
19
- exports . listMoviesRef = listMoviesRef ;
20
- exports . listMovies = function listMovies ( dc ) {
21
- return executeQuery ( listMoviesRef ( dc ) ) ;
19
+ exports . createMovieRef = createMovieRef ;
20
+ exports . createMovie = function createMovie ( dcOrVars , vars ) {
21
+ return executeMutation ( createMovieRef ( dcOrVars , vars ) ) ;
22
22
} ;
23
23
24
- function createMovieRef ( dcOrVars , vars ) {
25
- const { dc : dcInstance , vars : inputVars } = validateArgs ( connectorConfig , dcOrVars , vars , true ) ;
24
+ function listMoviesRef ( dc ) {
25
+ const { dc : dcInstance } = validateArgs ( connectorConfig , dc , undefined ) ;
26
26
if ( '_useGeneratedSdk' in dcInstance ) {
27
27
dcInstance . _useGeneratedSdk ( ) ;
28
28
} else {
29
29
console . error ( 'Please update to the latest version of the Data Connect SDK by running `npm install firebase@dataconnect-preview`.' ) ;
30
30
}
31
- return mutationRef ( dcInstance , 'CreateMovie' , inputVars ) ;
31
+ return queryRef ( dcInstance , 'ListMovies' ) ;
32
32
}
33
- exports . createMovieRef = createMovieRef ;
34
- exports . createMovie = function createMovie ( dcOrVars , vars ) {
35
- return executeMutation ( createMovieRef ( dcOrVars , vars ) ) ;
33
+ exports . listMoviesRef = listMoviesRef ;
34
+ exports . listMovies = function listMovies ( dc ) {
35
+ return executeQuery ( listMoviesRef ( dc ) ) ;
36
36
} ;
37
37
0 commit comments