@enonic-types/guillotine 0.0.1 → 0.0.2
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 +38 -38
- package/advanced.ts +2 -0
- package/index.ts +7 -0
- package/package.json +1 -1
- package/xp/index.d.ts +2 -0
package/README.md
CHANGED
|
@@ -14,44 +14,44 @@ const MY_FIELD_NAME = 'myField';
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
export const extensions = (graphQL: GraphQL): Extensions => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
17
|
+
return {
|
|
18
|
+
types: {
|
|
19
|
+
[MY_OBJECT_TYPE_NAME]: {
|
|
20
|
+
description: 'Description for my object type',
|
|
21
|
+
fields: {
|
|
22
|
+
myString: {
|
|
23
|
+
type: graphQL.nonNull(graphQL.GraphQLString),
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
creationCallbacks: {
|
|
29
|
+
[ObjectTypeName.Content]: (params) => {
|
|
30
|
+
params.addFields({
|
|
31
|
+
[MY_FIELD_NAME]: {
|
|
32
|
+
type: graphQL.reference(MY_OBJECT_TYPE_NAME)
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
resolvers: {
|
|
38
|
+
[ObjectTypeName.Content]: {
|
|
39
|
+
[MY_FIELD_NAME]: () => {
|
|
40
|
+
const {
|
|
41
|
+
// args,
|
|
42
|
+
// localContext,
|
|
43
|
+
source: content
|
|
44
|
+
} = env;
|
|
45
|
+
if (content.type === 'portal:fragment') {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
myString: 'Hello, World!'
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
```
|
package/advanced.ts
CHANGED
package/index.ts
CHANGED
package/package.json
CHANGED
package/xp/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import type {Content} from '@enonic-types/core';
|
|
|
2
2
|
import type {Site} from '@enonic-types/lib-content';
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
export declare type BaseFolderContent = Content<{}, 'base:folder'>;
|
|
6
|
+
|
|
5
7
|
export declare type MediaImageContent = Content<{
|
|
6
8
|
altText?: string
|
|
7
9
|
artist?: string[]
|