zeus-form 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +2 -3
- package/src/__tests__/consts.ts +15 -11
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "zeus-form",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.6",
|
4
4
|
"description": "Easy form creation with GraphQL Editor and React",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"scripts": {
|
@@ -22,12 +22,11 @@
|
|
22
22
|
"author": "Aexol <aexol@aexol.com> (http://aexol.com)",
|
23
23
|
"license": "MIT",
|
24
24
|
"homepage": "https://form.graphqleditor.com",
|
25
|
-
"devDependencies": {},
|
26
25
|
"peerDependencies": {
|
27
26
|
"react": ">=18",
|
28
27
|
"react-dom": ">=18"
|
29
28
|
},
|
30
29
|
"dependencies": {
|
31
|
-
"graphql-js-tree": "^0.
|
30
|
+
"graphql-js-tree": "^0.2.5"
|
32
31
|
}
|
33
32
|
}
|
package/src/__tests__/consts.ts
CHANGED
@@ -1,40 +1,44 @@
|
|
1
1
|
import { FormObject } from '@/models';
|
2
|
-
import { Options, ParserField, TypeDefinition } from 'graphql-js-tree';
|
2
|
+
import { createParserField, Options, ParserField, TypeDefinition } from 'graphql-js-tree';
|
3
3
|
|
4
4
|
// Global Arrange
|
5
|
-
export const typeNode: ParserField = {
|
5
|
+
export const typeNode: ParserField = createParserField({
|
6
6
|
name: 'Type',
|
7
7
|
args: [],
|
8
8
|
data: { type: TypeDefinition.ObjectTypeDefinition },
|
9
9
|
directives: [],
|
10
10
|
interfaces: [],
|
11
11
|
type: { fieldType: { name: 'type', type: Options.name } },
|
12
|
-
};
|
12
|
+
});
|
13
13
|
|
14
|
-
export const inputNode: ParserField = {
|
14
|
+
export const inputNode: ParserField = createParserField({
|
15
15
|
name: 'Input',
|
16
16
|
args: [],
|
17
17
|
data: { type: TypeDefinition.InputObjectTypeDefinition },
|
18
18
|
directives: [],
|
19
19
|
interfaces: [],
|
20
20
|
type: { fieldType: { name: 'type', type: Options.name } },
|
21
|
-
};
|
21
|
+
});
|
22
22
|
|
23
|
-
export const nodeWithArgs: ParserField = {
|
23
|
+
export const nodeWithArgs: ParserField = createParserField({
|
24
24
|
name: 'Root',
|
25
25
|
args: [typeNode, inputNode],
|
26
26
|
data: { type: TypeDefinition.ObjectTypeDefinition },
|
27
27
|
directives: [],
|
28
28
|
interfaces: [],
|
29
29
|
type: { fieldType: { name: 'type', type: Options.name } },
|
30
|
-
};
|
30
|
+
});
|
31
31
|
|
32
32
|
export const singleNode: ParserField[] = [typeNode];
|
33
33
|
export const nodes: ParserField[] = [typeNode, inputNode, nodeWithArgs];
|
34
34
|
|
35
|
-
export const fields: Record<string, FormObject> = { test: {
|
36
|
-
export const extenedFields: Record<string, FormObject> = {
|
37
|
-
|
35
|
+
export const fields: Record<string, FormObject> = { test: { __form__node: typeNode, __form__value: 5 } };
|
36
|
+
export const extenedFields: Record<string, FormObject> = {
|
37
|
+
testInput: { __form__node: inputNode, __form__value: fields },
|
38
|
+
};
|
39
|
+
export const fieldsNodeWithArgs: Record<string, FormObject> = {
|
40
|
+
testInput: { __form__node: nodeWithArgs, __form__value: fields },
|
41
|
+
};
|
38
42
|
export const fieldsNodeWithArgsWithInput: Record<string, FormObject> = {
|
39
|
-
testInput: {
|
43
|
+
testInput: { __form__node: nodeWithArgs, __form__value: extenedFields },
|
40
44
|
};
|