1
1
import { gql } from "apollo-server-express" ;
2
2
import { loadFile , loadImages , loadComments } from "../utils/figma" ;
3
3
import { generateResolversForShortcuts , generateQueriesForShortcuts } from "../utils/shortcuts" ;
4
- import { defaultImageParams } from "./image " ;
4
+ import { defaultImageParams } from "./export " ;
5
5
6
6
export const type = gql `
7
7
# Information about a file
@@ -19,7 +19,7 @@ export const type = gql`
19
19
version: String
20
20
21
21
# Get images for the file
22
- images (params: ImageParams): [Image ]
22
+ exports (params: ImageParams): [ExportResult ]
23
23
24
24
# Get comments for the file
25
25
comments: [Comment]
@@ -38,10 +38,10 @@ export const resolvers = {
38
38
file : ( _ , { id } ) => loadFile ( id ) . then ( data => data ) ,
39
39
} ,
40
40
File : {
41
- images : async ( { fileId } , { params } ) => {
41
+ exports : async ( { fileId } , { params } ) => {
42
42
const imageParams = { ...defaultImageParams , ...params } ;
43
43
const { images } = await loadImages ( fileId , imageParams ) ;
44
- return Object . entries ( images ) . map ( entry => ( { id : entry [ 0 ] , file : entry [ 1 ] } ) ) ;
44
+ return Object . entries ( images ) . map ( entry => ( { id : entry [ 0 ] , output : entry [ 1 ] } ) ) ;
45
45
} ,
46
46
comments : ( { fileId } ) => loadComments ( fileId ) . then ( ( { comments } ) => comments ) ,
47
47
...generateResolversForShortcuts ( ) ,
0 commit comments