@enonic-types/guillotine 9.0.0-B1 → 9.0.0-B3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -38,7 +38,7 @@ export const extensions = (graphQL: GraphQL): Extensions => {
38
38
  },
39
39
  resolvers: {
40
40
  [ObjectTypeName.Content]: {
41
- [MY_FIELD_NAME]: () => {
41
+ [MY_FIELD_NAME]: (env) => {
42
42
  const {
43
43
  // args,
44
44
  // localContext,
package/advanced.ts CHANGED
@@ -56,6 +56,7 @@ export type {
56
56
  export type {
57
57
  CreateDataFetcherResult,
58
58
  CreateDataFetcherResultParams,
59
+ DataFetcherResult,
59
60
  GraphQL,
60
61
  GraphQLArgs,
61
62
  GraphQLBaseScalars,
@@ -91,33 +92,61 @@ export type {
91
92
  export type {
92
93
  AccessControlEntry,
93
94
  Attachment,
95
+ AttachmentUrl,
94
96
  EnumTypeNames,
95
97
  InputTypeNames,
96
98
  ObjectTypeNames,
97
99
  ScalarTypeNames,
100
+ Component,
98
101
  Content,
99
102
  ContentConnection,
100
103
  ContentEdge,
101
104
  ContentType,
102
- ExtraData,
105
+ FormInput,
103
106
  FormItem,
107
+ FormItemSet,
108
+ FormLayout,
109
+ FormOptionSet,
110
+ FormOptionSetOption,
111
+ FragmentComponentData,
104
112
  GeoPoint,
113
+ HeadlessCms,
105
114
  Icon,
115
+ Image,
116
+ ImageComponentData,
117
+ ImageSource,
118
+ ImageStyle,
119
+ ImageUrl,
120
+ LayoutComponentData,
121
+ Link,
122
+ Macro,
123
+ Media,
106
124
  media_Image,
107
125
  media_Image_Data,
108
126
  MediaFocalPoint,
109
127
  MediaUploader,
128
+ Mixin,
129
+ Mixin_base_ApplicationConfig,
130
+ Mixin_base_gpsInfo_DataConfig,
131
+ Mixin_media_ApplicationConfig,
132
+ Mixin_media_cameraInfo_DataConfig,
133
+ Mixin_media_imageInfo_DataConfig,
134
+ Occurrences,
135
+ PageComponentData,
110
136
  PageInfo,
137
+ PageUrl,
138
+ PartComponentData,
111
139
  Permissions,
112
140
  portal_Site,
113
141
  portal_Site_Data,
114
142
  PrincipalKey,
115
143
  PublishInfo,
116
- XData_base_ApplicationConfig,
117
- XData_base_gpsInfo_DataConfig,
118
- XData_media_ApplicationConfig,
119
- XData_media_cameraInfo_DataConfig,
120
- XData_media_imageInfo_DataConfig,
144
+ Query,
145
+ QueryDSLContentConnection,
146
+ RichText,
147
+ SiteConfigurator,
148
+ TextComponentData,
149
+ UntypedContent,
121
150
  } from './guillotine'
122
151
 
123
152
  export type {
@@ -132,7 +161,9 @@ export {
132
161
  InputTypeName,
133
162
  ObjectTypeName,
134
163
  ScalarTypeName,
164
+ ComponentType,
135
165
  FormItemType,
166
+ MediaIntentType,
136
167
  Permission,
137
168
  PrincipalType,
138
169
  } from './guillotine'
@@ -1,5 +1,4 @@
1
- import type {GraphQLArgs} from '../graphQL/InputTypes'
2
- import type {GraphQLObjectType} from '../graphQL/ObjectTypes'
1
+ import type {GraphQLInterfaceType} from '../graphQL/InterfaceTypes'
3
2
  import type {GraphQLInterfaceTypeReference} from '../graphQL/ReferenceTypes'
4
3
  import type {Field} from './Field'
5
4
 
@@ -10,7 +9,7 @@ export declare interface CreationCallback {
10
9
  modifyFields: (existingFields: Record<string, Field>) => void
11
10
  removeFields: (existingFields: string[]) => void
12
11
  setDescription: (newDescription: string) => void
13
- setInterfaces: (reWrittenInterfaces: GraphQLInterfaceTypeReference[]) => void
12
+ setInterfaces: (reWrittenInterfaces: GraphQLInterfaceTypeReference<GraphQLInterfaceType>[]) => void
14
13
  }): void
15
14
  }
16
15
 
@@ -9,7 +9,7 @@ import type {Field} from './Field'
9
9
  export declare interface Type {
10
10
  description: string
11
11
  fields: Record<string, Field>
12
- interfaces: GraphQLInterfaceTypeReference<GraphQLInterfaceType>[]
12
+ interfaces?: GraphQLInterfaceTypeReference<GraphQLInterfaceType>[]
13
13
  }
14
14
 
15
15
  export declare type Types = Record<string, Type>
@@ -8,16 +8,26 @@ import type {
8
8
  } from './LocalContext'
9
9
 
10
10
 
11
+ declare const __dataFetcherResult: unique symbol
12
+
13
+
11
14
  export declare interface CreateDataFetcherResultParams<
12
- In extends LocalContextRecord = LocalContext,
13
- Out extends LocalContextRecord = LocalContext
15
+ In extends LocalContextRecord = LocalContextRecord,
16
+ Out extends LocalContextRecord = LocalContextRecord
14
17
  > {
15
- data: ScriptValue
16
- localContext?: LocalContext<Out>
18
+ // Objects and arrays must be wrapped with __.toScriptValue; primitives may be passed as is.
19
+ data: ScriptValue | string | number | boolean
20
+ localContext?: Out
17
21
  parentLocalContext?: LocalContext<In>
18
22
  }
19
23
 
24
+ // Opaque value returned by createDataFetcherResult.
25
+ // Return it from a resolver as is; Guillotine unwraps data and localContext.
26
+ export declare interface DataFetcherResult {
27
+ readonly [__dataFetcherResult]: true
28
+ }
29
+
20
30
  export declare type CreateDataFetcherResult = <
21
- In extends LocalContextRecord = LocalContext,
22
- Out extends LocalContextRecord = LocalContext
23
- >(params: CreateDataFetcherResultParams<In,Out>) => LocalContext<In&Out>
31
+ In extends LocalContextRecord = LocalContextRecord,
32
+ Out extends LocalContextRecord = LocalContextRecord
33
+ >(params: CreateDataFetcherResultParams<In,Out>) => DataFetcherResult
@@ -5,5 +5,5 @@ export declare type LocalContext<
5
5
  > = {
6
6
  branch: string
7
7
  project: string
8
- siteKey?: string
8
+ scopeKey?: string
9
9
  } & T
@@ -50,6 +50,7 @@ import type {
50
50
  export type {
51
51
  CreateDataFetcherResult,
52
52
  CreateDataFetcherResultParams,
53
+ DataFetcherResult,
53
54
  } from './CreateDataFetcherResult'
54
55
 
55
56
  export type {
@@ -1,7 +1,6 @@
1
1
  // This is a value, do not add declare.
2
2
  export enum EnumTypeName {
3
3
  ComponentType = 'ComponentType',
4
- ContentPathType = 'ContentPathType',
5
4
  DslGeoPointDistanceType = 'DslGeoPointDistanceType',
6
5
  DslOperatorType = 'DslOperatorType',
7
6
  DslSortDirectionType = 'DslSortDirectionType',
@@ -19,6 +18,16 @@ export declare type EnumTypeNames = keyof typeof EnumTypeName
19
18
 
20
19
  //──────────────────────────────────────────────────────────────────────────────
21
20
 
21
+ // This is a value, do not add declare.
22
+ export enum ComponentType {
23
+ page = 'page',
24
+ layout = 'layout',
25
+ image = 'image',
26
+ part = 'part',
27
+ text = 'text',
28
+ fragment = 'fragment',
29
+ }
30
+
22
31
  // This is a value, do not add declare.
23
32
  export enum FormItemType {
24
33
  ItemSet = 'ItemSet',
@@ -10,29 +10,57 @@ export type {
10
10
  ObjectTypeNames,
11
11
  AccessControlEntry,
12
12
  Attachment,
13
+ AttachmentUrl,
14
+ Component,
13
15
  Content,
14
16
  ContentConnection,
15
17
  ContentEdge,
16
18
  ContentType,
17
- ExtraData,
19
+ FormInput,
18
20
  FormItem,
21
+ FormItemSet,
22
+ FormLayout,
23
+ FormOptionSet,
24
+ FormOptionSetOption,
25
+ FragmentComponentData,
19
26
  GeoPoint,
27
+ HeadlessCms,
20
28
  Icon,
29
+ Image,
30
+ ImageComponentData,
31
+ ImageSource,
32
+ ImageStyle,
33
+ ImageUrl,
34
+ LayoutComponentData,
35
+ Link,
36
+ Macro,
37
+ Media,
21
38
  media_Image,
22
39
  media_Image_Data,
23
40
  MediaFocalPoint,
24
41
  MediaUploader,
42
+ Mixin,
43
+ Mixin_base_ApplicationConfig,
44
+ Mixin_base_gpsInfo_DataConfig,
45
+ Mixin_media_ApplicationConfig,
46
+ Mixin_media_cameraInfo_DataConfig,
47
+ Mixin_media_imageInfo_DataConfig,
48
+ Occurrences,
49
+ PageComponentData,
25
50
  PageInfo,
51
+ PageUrl,
52
+ PartComponentData,
26
53
  Permissions,
27
54
  portal_Site,
28
55
  portal_Site_Data,
29
56
  PrincipalKey,
30
57
  PublishInfo,
31
- XData_base_ApplicationConfig,
32
- XData_base_gpsInfo_DataConfig,
33
- XData_media_ApplicationConfig,
34
- XData_media_cameraInfo_DataConfig,
35
- XData_media_imageInfo_DataConfig,
58
+ Query,
59
+ QueryDSLContentConnection,
60
+ RichText,
61
+ SiteConfigurator,
62
+ TextComponentData,
63
+ UntypedContent,
36
64
  } from './objectTypes'
37
65
 
38
66
  export type {
@@ -42,6 +70,7 @@ export type {
42
70
 
43
71
 
44
72
  export {
73
+ ComponentType,
45
74
  EnumTypeName,
46
75
  FormItemType,
47
76
  MediaIntentType,
@@ -2,30 +2,23 @@
2
2
  export enum InputTypeName {
3
3
  AggregationInput = 'AggregationInput',
4
4
  BooleanDSLExpressionInput = 'BooleanDSLExpressionInput',
5
- BooleanFilterInput = 'BooleanFilterInput',
6
5
  DSLExpressionValueInput = 'DSLExpressionValueInput',
7
6
  DateHistogramAggregationInput = 'DateHistogramAggregationInput',
8
7
  DateRangeAggregationInput = 'DateRangeAggregationInput',
9
8
  DateRangeInput = 'DateRangeInput',
10
9
  ExistsDSLExpressionInput = 'ExistsDSLExpressionInput',
11
- ExistsFilterInput = 'ExistsFilterInput',
12
- FilterInput = 'FilterInput',
13
- FormInput = 'FormInput',
14
10
  FulltextDSLExpressionInput = 'FulltextDSLExpressionInput',
15
11
  GeoDistanceAggregationInput = 'GeoDistanceAggregationInput',
16
12
  GeoPointInput = 'GeoPointInput',
17
13
  GeoPointSortDslInput = 'GeoPointSortDslInput',
18
- HasValueFilterInput = 'HasValueFilterInput',
19
14
  HighlightInputType = 'HighlightInputType',
20
15
  HighlightPropertiesInputType = 'HighlightPropertiesInputType',
21
- IdsFilterInput = 'IdsFilterInput',
22
16
  InDSLExpressionInput = 'InDSLExpressionInput',
23
17
  LikeDSLExpressionInput = 'LikeDSLExpressionInput',
24
18
  MatchAllDSLExpressionInput = 'MatchAllDSLExpressionInput',
25
19
  MaxAggregationInput = 'MaxAggregationInput',
26
20
  MinAggregationInput = 'MinAggregationInput',
27
21
  NgramDSLExpressionInput = 'NgramDSLExpressionInput',
28
- NotExistsFilterInput = 'NotExistsFilterInput',
29
22
  NumberRangeInput = 'NumberRangeInput',
30
23
  PathMatchDSLExpressionInput = 'PathMatchDSLExpressionInput',
31
24
  ProcessHtmlInput = 'ProcessHtmlInput',
@@ -4,6 +4,7 @@ import type {
4
4
  NonNull
5
5
  } from '../brand'
6
6
  import type {
7
+ ComponentType,
7
8
  FormItemType,
8
9
  MediaIntentType,
9
10
  Permission,
@@ -42,8 +43,7 @@ export enum ObjectTypeName {
42
43
  ContentConnection = 'ContentConnection',
43
44
  ContentEdge = 'ContentEdge',
44
45
  ContentType = 'ContentType',
45
- DefaultValue = 'DefaultValue',
46
- ExtraData = 'ExtraData',
46
+ FormInput = 'FormInput',
47
47
  FormItem = 'FormItem',
48
48
  FormItemSet = 'FormItemSet',
49
49
  FormLayout = 'FormLayout',
@@ -55,6 +55,7 @@ export enum ObjectTypeName {
55
55
  Icon = 'Icon',
56
56
  Image = 'Image',
57
57
  ImageComponentData = 'ImageComponentData',
58
+ ImageSource = 'ImageSource',
58
59
  ImageStyle = 'ImageStyle',
59
60
  ImageUrl = 'ImageUrl',
60
61
  LayoutComponentData = 'LayoutComponentData',
@@ -67,6 +68,7 @@ export enum ObjectTypeName {
67
68
  Media = 'Media',
68
69
  MediaFocalPoint = 'MediaFocalPoint',
69
70
  MediaUploader = 'MediaUploader',
71
+ Mixin = 'Mixin',
70
72
  media_Archive = 'media_Archive',
71
73
  media_Archive_Data = 'media_Archive_Data',
72
74
  media_Audio = 'media_Audio',
@@ -112,7 +114,7 @@ export enum ObjectTypeName {
112
114
  portal_TemplateFolder = 'portal_TemplateFolder',
113
115
  PrincipalKey = 'PrincipalKey',
114
116
  PublishInfo = 'PublishInfo',
115
- QueryContentConnection = 'QueryContentConnection',
117
+ Query = 'Query',
116
118
  QueryDSLContentConnection = 'QueryDSLContentConnection',
117
119
  RichText = 'RichText',
118
120
  // RobotsTxt = 'RobotsTxt', // Not builtin?
@@ -146,7 +148,6 @@ export declare interface Attachment {
146
148
  }
147
149
 
148
150
  export declare interface AttachmentUrl {
149
- url: GraphQLString
150
151
  path: GraphQLString
151
152
  queryString: GraphQLString
152
153
  context: GraphQLString
@@ -166,10 +167,12 @@ export declare type Content<
166
167
  _path: NonNull<GraphQLString>
167
168
  _references: Content[]
168
169
  _score: GraphQLFloat
170
+ _project: GraphQLString
171
+ _branch: GraphQLString
169
172
  attachments: Attachment[]
170
173
  children: Content[]
171
174
  childrenConnection: ContentConnection
172
- components: Content[]
175
+ components: Component[]
173
176
  contentType: ContentType
174
177
  createdTime: GraphQLDateTime
175
178
  creator: PrincipalKey
@@ -194,6 +197,17 @@ export declare type Content<
194
197
  CoreContent
195
198
  >
196
199
 
200
+ export declare interface Component {
201
+ type: NonNull<ComponentType> // enum
202
+ path: NonNull<GraphQLString>
203
+ part: PartComponentData
204
+ page: PageComponentData
205
+ layout: LayoutComponentData
206
+ image: ImageComponentData
207
+ text: TextComponentData
208
+ fragment: FragmentComponentData
209
+ }
210
+
197
211
  export declare interface ContentConnection {
198
212
  totalCount: NonNull<GraphQLInt>
199
213
  edges?: ContentEdge[]
@@ -229,25 +243,102 @@ export declare interface Mixin {
229
243
  base: Mixin_base_ApplicationConfig
230
244
  }
231
245
 
246
+ export declare interface FormInput extends FormItem {
247
+ helpText: GraphQLString
248
+ inputType: GraphQLString
249
+ occurrences: Occurrences
250
+ configAsJson: GraphQLJson
251
+ }
252
+
253
+ // Interface implemented by FormInput, FormItemSet, FormLayout and FormOptionSet.
232
254
  export declare interface FormItem {
233
255
  formItemType: FormItemType // enum
234
256
  name: GraphQLString
235
257
  label: GraphQLString
236
258
  }
237
259
 
260
+ export declare interface FormItemSet extends FormItem {
261
+ helpText: GraphQLString
262
+ occurrences: Occurrences
263
+ items: FormItem[]
264
+ }
265
+
266
+ export declare interface FormLayout extends FormItem {
267
+ items: FormItem[]
268
+ }
269
+
270
+ export declare interface FormOptionSet extends FormItem {
271
+ expanded: GraphQLBoolean
272
+ helpText: GraphQLString
273
+ occurrences: Occurrences
274
+ selection: Occurrences
275
+ options: FormOptionSetOption[]
276
+ }
277
+
278
+ export declare interface FormOptionSetOption {
279
+ name: GraphQLString
280
+ label: GraphQLString
281
+ helpText: GraphQLString
282
+ default: GraphQLBoolean
283
+ items: FormItem[]
284
+ }
285
+
286
+ export declare interface FragmentComponentData {
287
+ id: NonNull<GraphQLID>
288
+ fragment: Content
289
+ }
290
+
238
291
  export declare interface GeoPoint {
239
292
  value: GraphQLString
240
293
  latitude: GraphQLFloat
241
294
  longitude: GraphQLFloat
242
295
  }
243
296
 
297
+ // Type of the Query.guillotine field. Extensions may add fields via creationCallbacks.
298
+ export declare interface HeadlessCms {
299
+ get: Content
300
+ getChildren: Content[]
301
+ getChildrenConnection: ContentConnection
302
+ getPermissions: Permissions
303
+ getSite: portal_Site
304
+ queryDsl: Content[]
305
+ queryDslConnection: QueryDSLContentConnection
306
+ getType: ContentType
307
+ getTypes: ContentType[]
308
+ }
309
+
244
310
  export declare interface Icon {
245
311
  mimeType: GraphQLString
246
312
  modifiedTime: GraphQLString
247
313
  }
248
314
 
315
+ export declare interface Image {
316
+ image: Content
317
+ ref: GraphQLString
318
+ style: ImageStyle
319
+ src: ImageUrl
320
+ srcset: ImageSource[]
321
+ }
322
+
323
+ export declare interface ImageComponentData {
324
+ id: NonNull<GraphQLID>
325
+ caption: GraphQLString
326
+ image: media_Image
327
+ }
328
+
329
+ export declare interface ImageSource {
330
+ width: GraphQLInt
331
+ imageUrl: ImageUrl
332
+ }
333
+
334
+ export declare interface ImageStyle {
335
+ application: GraphQLString
336
+ name: GraphQLString
337
+ aspectRatio: GraphQLString
338
+ filter: GraphQLString
339
+ }
340
+
249
341
  export declare interface ImageUrl {
250
- url: GraphQLString
251
342
  path: GraphQLString
252
343
  queryString: GraphQLString
253
344
  context: GraphQLString
@@ -257,6 +348,34 @@ export declare interface ImageUrl {
257
348
  name: GraphQLString
258
349
  }
259
350
 
351
+ export declare interface LayoutComponentData {
352
+ descriptor: NonNull<GraphQLString>
353
+ configAsJson: GraphQLJson
354
+ config: Record<string, unknown> // LayoutComponentDataConfig, generated from installed applications
355
+ }
356
+
357
+ export declare interface Link {
358
+ ref: GraphQLString
359
+ uri: GraphQLString
360
+ media: Media
361
+ content: Content
362
+ pageUrl: PageUrl
363
+ fragment: GraphQLString
364
+ }
365
+
366
+ export declare interface Macro {
367
+ ref: GraphQLString
368
+ name: GraphQLString
369
+ descriptor: GraphQLString
370
+ config: Record<string, unknown> // MacroConfig, generated from installed applications
371
+ }
372
+
373
+ export declare interface Media {
374
+ content: Content
375
+ intent: MediaIntentType // enum
376
+ mediaUrl: AttachmentUrl
377
+ }
378
+
260
379
  export declare type media_Image = BrandGraphQLObjectType<
261
380
  'media_Image',
262
381
  {
@@ -286,6 +405,19 @@ export declare interface MediaUploader {
286
405
  focalPoint: MediaFocalPoint
287
406
  }
288
407
 
408
+ export declare interface Occurrences {
409
+ maximum: GraphQLInt
410
+ minimum: GraphQLInt
411
+ }
412
+
413
+ export declare interface PageComponentData {
414
+ descriptor: GraphQLString
415
+ customized: GraphQLBoolean
416
+ template: Content
417
+ configAsJson: GraphQLJson
418
+ config: Record<string, unknown> // PageComponentDataConfig, generated from installed applications
419
+ }
420
+
289
421
  export declare interface PageInfo {
290
422
  startCursor: NonNull<GraphQLString>
291
423
  endCursor: NonNull<GraphQLString>
@@ -293,13 +425,18 @@ export declare interface PageInfo {
293
425
  }
294
426
 
295
427
  export declare interface PageUrl {
296
- url: GraphQLString
428
+ baseUrl: GraphQLString
297
429
  path: GraphQLString
298
430
  queryString: GraphQLString
299
431
  }
300
432
 
433
+ export declare interface PartComponentData {
434
+ descriptor: NonNull<GraphQLString>
435
+ configAsJson: GraphQLJson
436
+ config: Record<string, unknown> // PartComponentDataConfig, generated from installed applications
437
+ }
438
+
301
439
  export declare interface Permissions {
302
- inheritsPermissions: GraphQLBoolean
303
440
  permissions: AccessControlEntry[]
304
441
  }
305
442
 
@@ -323,11 +460,43 @@ export declare interface PrincipalKey {
323
460
  }
324
461
 
325
462
  export declare interface PublishInfo {
326
- from: GraphQLString
327
- to: GraphQLString
328
- first: GraphQLString
463
+ from: GraphQLDateTime
464
+ to: GraphQLDateTime
465
+ first: GraphQLDateTime
466
+ time: GraphQLDateTime
467
+ }
468
+
469
+ // Root query type. Extensions may add fields via creationCallbacks.
470
+ export declare interface Query {
471
+ guillotine: HeadlessCms
329
472
  }
330
473
 
474
+ export declare interface QueryDSLContentConnection extends ContentConnection {
475
+ aggregationsAsJson: GraphQLJson
476
+ highlightAsJson: GraphQLJson
477
+ }
478
+
479
+ export declare interface RichText {
480
+ raw: GraphQLString
481
+ processedHtml: GraphQLString
482
+ macrosAsJson: GraphQLJson
483
+ macros: Macro[]
484
+ images: Image[]
485
+ links: Link[]
486
+ }
487
+
488
+ export declare interface SiteConfigurator {
489
+ applicationKey: GraphQLString
490
+ configAsJson: GraphQLJson
491
+ }
492
+
493
+ export declare interface TextComponentData {
494
+ value: NonNull<RichText>
495
+ }
496
+
497
+ // Object type used for content whose content type is not part of the schema; same fields as Content.
498
+ export declare type UntypedContent = Content
499
+
331
500
  export declare interface Mixin_base_ApplicationConfig {
332
501
  gpsInfo: Mixin_base_gpsInfo_DataConfig
333
502
  }
package/index.ts CHANGED
@@ -4,6 +4,7 @@ import type {ScriptValue} from '@enonic-types/core'
4
4
 
5
5
 
6
6
  declare const __name: unique symbol
7
+ declare const __dataFetcherResult: unique symbol
7
8
 
8
9
  declare type BrandGraphQLScalarType<
9
10
  GQL_SCALAR_TYPE_NAME extends string,
@@ -25,6 +26,12 @@ export declare type GraphQLString = BrandGraphQLScalarType<'GraphQLString', stri
25
26
 
26
27
  export declare type GraphQLType = any
27
28
 
29
+ // Opaque value returned by GraphQL.createDataFetcherResult.
30
+ // Return it from a resolver as is; Guillotine unwraps data and localContext.
31
+ declare interface DataFetcherResult {
32
+ readonly [__dataFetcherResult]: true
33
+ }
34
+
28
35
  export declare interface GraphQL {
29
36
  Date: GraphQLDate
30
37
  DateTime: GraphQLDateTime
@@ -36,14 +43,12 @@ export declare interface GraphQL {
36
43
  Json: GraphQLJson
37
44
  LocalDateTime: GraphQLLocalDateTime
38
45
  LocalTime: GraphQLLocalTime
39
- createDataFetcherResult: <
40
- In extends LocalContextRecord = LocalContext,
41
- Out extends LocalContextRecord = LocalContext
42
- > () => {
43
- data: ScriptValue
44
- localContext?: LocalContext<Out>
45
- parentLocalContext?: LocalContext<In>
46
- }
46
+ createDataFetcherResult: (params: {
47
+ // Objects and arrays must be wrapped with __.toScriptValue; primitives may be passed as is.
48
+ data: ScriptValue | string | number | boolean
49
+ localContext?: LocalContextRecord
50
+ parentLocalContext?: LocalContext
51
+ }) => DataFetcherResult
47
52
  nonNull: (type: GraphQLType) => GraphQLType
48
53
  list: (type: GraphQLType) => GraphQLType[]
49
54
  reference: (typeName: string) => GraphQLType
@@ -79,7 +84,7 @@ export declare type LocalContext<
79
84
  > = {
80
85
  branch: string
81
86
  project: string
82
- siteKey?: string
87
+ scopeKey?: string
83
88
  } & T
84
89
 
85
90
  export declare interface DataFetchingEnvironment<
@@ -122,19 +127,23 @@ export declare interface Extensions {
122
127
  type: GraphQLType | GraphQLType[]
123
128
  }>
124
129
  }>
130
+ // Resolvers may narrow Args and Source via DataFetchingEnvironment<Args, Source>,
131
+ // so the map must accept any resolver signature under strictFunctionTypes.
125
132
  resolvers?: Record<
126
133
  string,
127
134
  Record<
128
135
  string,
129
- Resolver
136
+ Resolver<any, any, any>
130
137
  >
131
138
  >
132
139
  typeResolvers?: Record<string, (param: any) => string>
133
140
  types?: Record<string, {
134
141
  description: string
135
142
  fields: Record<string, {
143
+ args?: GraphQLArgs
136
144
  type: GraphQLType | GraphQLType[]
137
145
  }>
146
+ interfaces?: GraphQLType[]
138
147
  }>
139
148
  unions?: Record<string, {
140
149
  description: string
@@ -151,9 +160,11 @@ export type {
151
160
 
152
161
 
153
162
  export {
163
+ ComponentType,
154
164
  EnumTypeName,
155
165
  FormItemType,
156
166
  InputTypeName,
167
+ MediaIntentType,
157
168
  ObjectTypeName,
158
169
  Permission,
159
170
  PrincipalType,
package/package.json CHANGED
@@ -42,8 +42,8 @@
42
42
  },
43
43
  "scripts": {
44
44
  "check": "npx tsc --noEmit",
45
- "test": "tsd ./"
45
+ "test": "tsd ./ --files \"test-d/**/*.test-d.ts\""
46
46
  },
47
47
  "types": "index.ts",
48
- "version": "9.0.0-B1"
48
+ "version": "9.0.0-B3"
49
49
  }