gql-ast 0.1.9 → 2.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/LICENSE +1 -1
- package/README.md +13 -1
- package/esm/index.js +106 -0
- package/index.d.ts +67 -0
- package/index.js +127 -0
- package/package.json +20 -50
- package/CHANGELOG.md +0 -127
- package/main/index.js +0 -235
- package/module/index.js +0 -154
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2024 Dan Lynch <pyramation@gmail.com>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Super bare-bones GraphQL AST utils
|
|
4
4
|
|
|
5
|
+
<p align="center" width="100%">
|
|
6
|
+
<img height="250" src="https://github.com/user-attachments/assets/d0456af5-b6e9-422e-a45d-2574d5be490f" />
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center" width="100%">
|
|
10
|
+
<a href="https://github.com/launchql/launchql-2.0/actions/workflows/run-tests.yaml">
|
|
11
|
+
<img height="20" src="https://github.com/launchql/launchql-2.0/actions/workflows/run-tests.yaml/badge.svg" />
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://github.com/launchql/launchql-2.0/blob/main/LICENSE-MIT"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/gql-ast"><img height="20" src="https://img.shields.io/github/package-json/v/launchql/launchql-2.0?filename=packages%2Fgql-ast%2Fpackage.json"/></a>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
5
17
|
```sh
|
|
6
18
|
npm install gql-ast
|
|
7
19
|
```
|
|
@@ -19,4 +31,4 @@ const ast = t.document({
|
|
|
19
31
|
})
|
|
20
32
|
]
|
|
21
33
|
});
|
|
22
|
-
```
|
|
34
|
+
```
|
package/esm/index.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export const document = ({ definitions }) => ({
|
|
2
|
+
kind: 'Document',
|
|
3
|
+
definitions,
|
|
4
|
+
});
|
|
5
|
+
export const operationDefinition = ({ operation, name, variableDefinitions = [], directives = [], selectionSet, }) => ({
|
|
6
|
+
kind: 'OperationDefinition',
|
|
7
|
+
operation,
|
|
8
|
+
name: {
|
|
9
|
+
kind: 'Name',
|
|
10
|
+
value: name,
|
|
11
|
+
},
|
|
12
|
+
variableDefinitions,
|
|
13
|
+
directives,
|
|
14
|
+
selectionSet,
|
|
15
|
+
});
|
|
16
|
+
export const variableDefinition = ({ variable, type, directives, }) => ({
|
|
17
|
+
kind: 'VariableDefinition',
|
|
18
|
+
variable,
|
|
19
|
+
type,
|
|
20
|
+
directives: directives || [],
|
|
21
|
+
});
|
|
22
|
+
export const selectionSet = ({ selections }) => ({
|
|
23
|
+
kind: 'SelectionSet',
|
|
24
|
+
selections,
|
|
25
|
+
});
|
|
26
|
+
export const listType = ({ type }) => ({
|
|
27
|
+
kind: 'ListType',
|
|
28
|
+
type,
|
|
29
|
+
});
|
|
30
|
+
export const nonNullType = ({ type }) => ({
|
|
31
|
+
kind: 'NonNullType',
|
|
32
|
+
type,
|
|
33
|
+
});
|
|
34
|
+
export const namedType = ({ type }) => ({
|
|
35
|
+
kind: 'NamedType',
|
|
36
|
+
name: {
|
|
37
|
+
kind: 'Name',
|
|
38
|
+
value: type,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
export const variable = ({ name }) => ({
|
|
42
|
+
kind: 'Variable',
|
|
43
|
+
name: {
|
|
44
|
+
kind: 'Name',
|
|
45
|
+
value: name,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
export const objectValue = ({ fields }) => ({
|
|
49
|
+
kind: 'ObjectValue',
|
|
50
|
+
fields,
|
|
51
|
+
});
|
|
52
|
+
export const stringValue = ({ value }) => ({
|
|
53
|
+
kind: 'StringValue',
|
|
54
|
+
value,
|
|
55
|
+
});
|
|
56
|
+
export const intValue = ({ value }) => ({
|
|
57
|
+
kind: 'IntValue',
|
|
58
|
+
value,
|
|
59
|
+
});
|
|
60
|
+
export const booleanValue = ({ value }) => ({
|
|
61
|
+
kind: 'BooleanValue',
|
|
62
|
+
value,
|
|
63
|
+
});
|
|
64
|
+
export const listValue = ({ values }) => ({
|
|
65
|
+
kind: 'ListValue',
|
|
66
|
+
values,
|
|
67
|
+
});
|
|
68
|
+
export const nullValue = () => ({
|
|
69
|
+
kind: 'NullValue',
|
|
70
|
+
});
|
|
71
|
+
export const fragmentDefinition = ({ name, typeCondition, directives = [], selectionSet, }) => ({
|
|
72
|
+
kind: 'FragmentDefinition',
|
|
73
|
+
name: {
|
|
74
|
+
kind: 'Name',
|
|
75
|
+
value: name,
|
|
76
|
+
},
|
|
77
|
+
typeCondition,
|
|
78
|
+
directives,
|
|
79
|
+
selectionSet,
|
|
80
|
+
});
|
|
81
|
+
export const objectField = ({ name, value }) => ({
|
|
82
|
+
kind: 'ObjectField',
|
|
83
|
+
name: {
|
|
84
|
+
kind: 'Name',
|
|
85
|
+
value: name,
|
|
86
|
+
},
|
|
87
|
+
value,
|
|
88
|
+
});
|
|
89
|
+
export const field = ({ name, args = [], directives = [], selectionSet, }) => ({
|
|
90
|
+
kind: 'Field',
|
|
91
|
+
name: {
|
|
92
|
+
kind: 'Name',
|
|
93
|
+
value: name,
|
|
94
|
+
},
|
|
95
|
+
arguments: args,
|
|
96
|
+
directives,
|
|
97
|
+
selectionSet,
|
|
98
|
+
});
|
|
99
|
+
export const argument = ({ name, value }) => ({
|
|
100
|
+
kind: 'Argument',
|
|
101
|
+
name: {
|
|
102
|
+
kind: 'Name',
|
|
103
|
+
value: name,
|
|
104
|
+
},
|
|
105
|
+
value,
|
|
106
|
+
});
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ArgumentNode, BooleanValueNode, DefinitionNode, DocumentNode, FieldNode, FragmentDefinitionNode, IntValueNode, ListTypeNode, ListValueNode, NamedTypeNode, NullValueNode, ObjectFieldNode, ObjectValueNode, OperationDefinitionNode, OperationTypeNode, SelectionSetNode, StringValueNode, VariableDefinitionNode, VariableNode, DirectiveNode, TypeNode } from 'graphql';
|
|
2
|
+
export declare const document: ({ definitions }: {
|
|
3
|
+
definitions: DefinitionNode[];
|
|
4
|
+
}) => DocumentNode;
|
|
5
|
+
export declare const operationDefinition: ({ operation, name, variableDefinitions, directives, selectionSet, }: {
|
|
6
|
+
operation: OperationTypeNode;
|
|
7
|
+
name: string;
|
|
8
|
+
variableDefinitions?: VariableDefinitionNode[];
|
|
9
|
+
directives?: DirectiveNode[];
|
|
10
|
+
selectionSet: SelectionSetNode;
|
|
11
|
+
}) => OperationDefinitionNode;
|
|
12
|
+
export declare const variableDefinition: ({ variable, type, directives, }: {
|
|
13
|
+
variable: VariableNode;
|
|
14
|
+
type: TypeNode;
|
|
15
|
+
directives?: DirectiveNode[];
|
|
16
|
+
}) => VariableDefinitionNode;
|
|
17
|
+
export declare const selectionSet: ({ selections }: {
|
|
18
|
+
selections: readonly FieldNode[];
|
|
19
|
+
}) => SelectionSetNode;
|
|
20
|
+
export declare const listType: ({ type }: {
|
|
21
|
+
type: TypeNode;
|
|
22
|
+
}) => ListTypeNode;
|
|
23
|
+
export declare const nonNullType: ({ type }: {
|
|
24
|
+
type: NamedTypeNode | ListTypeNode;
|
|
25
|
+
}) => TypeNode;
|
|
26
|
+
export declare const namedType: ({ type }: {
|
|
27
|
+
type: string;
|
|
28
|
+
}) => NamedTypeNode;
|
|
29
|
+
export declare const variable: ({ name }: {
|
|
30
|
+
name: string;
|
|
31
|
+
}) => VariableNode;
|
|
32
|
+
export declare const objectValue: ({ fields }: {
|
|
33
|
+
fields: ObjectFieldNode[];
|
|
34
|
+
}) => ObjectValueNode;
|
|
35
|
+
export declare const stringValue: ({ value }: {
|
|
36
|
+
value: string;
|
|
37
|
+
}) => StringValueNode;
|
|
38
|
+
export declare const intValue: ({ value }: {
|
|
39
|
+
value: string;
|
|
40
|
+
}) => IntValueNode;
|
|
41
|
+
export declare const booleanValue: ({ value }: {
|
|
42
|
+
value: boolean;
|
|
43
|
+
}) => BooleanValueNode;
|
|
44
|
+
export declare const listValue: ({ values }: {
|
|
45
|
+
values: any[];
|
|
46
|
+
}) => ListValueNode;
|
|
47
|
+
export declare const nullValue: () => NullValueNode;
|
|
48
|
+
export declare const fragmentDefinition: ({ name, typeCondition, directives, selectionSet, }: {
|
|
49
|
+
name: string;
|
|
50
|
+
typeCondition: NamedTypeNode;
|
|
51
|
+
directives?: DirectiveNode[];
|
|
52
|
+
selectionSet: SelectionSetNode;
|
|
53
|
+
}) => FragmentDefinitionNode;
|
|
54
|
+
export declare const objectField: ({ name, value }: {
|
|
55
|
+
name: string;
|
|
56
|
+
value: any;
|
|
57
|
+
}) => ObjectFieldNode;
|
|
58
|
+
export declare const field: ({ name, args, directives, selectionSet, }: {
|
|
59
|
+
name: string;
|
|
60
|
+
args?: ArgumentNode[];
|
|
61
|
+
directives?: DirectiveNode[];
|
|
62
|
+
selectionSet?: SelectionSetNode;
|
|
63
|
+
}) => FieldNode;
|
|
64
|
+
export declare const argument: ({ name, value }: {
|
|
65
|
+
name: string;
|
|
66
|
+
value: any;
|
|
67
|
+
}) => ArgumentNode;
|
package/index.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.argument = exports.field = exports.objectField = exports.fragmentDefinition = exports.nullValue = exports.listValue = exports.booleanValue = exports.intValue = exports.stringValue = exports.objectValue = exports.variable = exports.namedType = exports.nonNullType = exports.listType = exports.selectionSet = exports.variableDefinition = exports.operationDefinition = exports.document = void 0;
|
|
4
|
+
const document = ({ definitions }) => ({
|
|
5
|
+
kind: 'Document',
|
|
6
|
+
definitions,
|
|
7
|
+
});
|
|
8
|
+
exports.document = document;
|
|
9
|
+
const operationDefinition = ({ operation, name, variableDefinitions = [], directives = [], selectionSet, }) => ({
|
|
10
|
+
kind: 'OperationDefinition',
|
|
11
|
+
operation,
|
|
12
|
+
name: {
|
|
13
|
+
kind: 'Name',
|
|
14
|
+
value: name,
|
|
15
|
+
},
|
|
16
|
+
variableDefinitions,
|
|
17
|
+
directives,
|
|
18
|
+
selectionSet,
|
|
19
|
+
});
|
|
20
|
+
exports.operationDefinition = operationDefinition;
|
|
21
|
+
const variableDefinition = ({ variable, type, directives, }) => ({
|
|
22
|
+
kind: 'VariableDefinition',
|
|
23
|
+
variable,
|
|
24
|
+
type,
|
|
25
|
+
directives: directives || [],
|
|
26
|
+
});
|
|
27
|
+
exports.variableDefinition = variableDefinition;
|
|
28
|
+
const selectionSet = ({ selections }) => ({
|
|
29
|
+
kind: 'SelectionSet',
|
|
30
|
+
selections,
|
|
31
|
+
});
|
|
32
|
+
exports.selectionSet = selectionSet;
|
|
33
|
+
const listType = ({ type }) => ({
|
|
34
|
+
kind: 'ListType',
|
|
35
|
+
type,
|
|
36
|
+
});
|
|
37
|
+
exports.listType = listType;
|
|
38
|
+
const nonNullType = ({ type }) => ({
|
|
39
|
+
kind: 'NonNullType',
|
|
40
|
+
type,
|
|
41
|
+
});
|
|
42
|
+
exports.nonNullType = nonNullType;
|
|
43
|
+
const namedType = ({ type }) => ({
|
|
44
|
+
kind: 'NamedType',
|
|
45
|
+
name: {
|
|
46
|
+
kind: 'Name',
|
|
47
|
+
value: type,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
exports.namedType = namedType;
|
|
51
|
+
const variable = ({ name }) => ({
|
|
52
|
+
kind: 'Variable',
|
|
53
|
+
name: {
|
|
54
|
+
kind: 'Name',
|
|
55
|
+
value: name,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
exports.variable = variable;
|
|
59
|
+
const objectValue = ({ fields }) => ({
|
|
60
|
+
kind: 'ObjectValue',
|
|
61
|
+
fields,
|
|
62
|
+
});
|
|
63
|
+
exports.objectValue = objectValue;
|
|
64
|
+
const stringValue = ({ value }) => ({
|
|
65
|
+
kind: 'StringValue',
|
|
66
|
+
value,
|
|
67
|
+
});
|
|
68
|
+
exports.stringValue = stringValue;
|
|
69
|
+
const intValue = ({ value }) => ({
|
|
70
|
+
kind: 'IntValue',
|
|
71
|
+
value,
|
|
72
|
+
});
|
|
73
|
+
exports.intValue = intValue;
|
|
74
|
+
const booleanValue = ({ value }) => ({
|
|
75
|
+
kind: 'BooleanValue',
|
|
76
|
+
value,
|
|
77
|
+
});
|
|
78
|
+
exports.booleanValue = booleanValue;
|
|
79
|
+
const listValue = ({ values }) => ({
|
|
80
|
+
kind: 'ListValue',
|
|
81
|
+
values,
|
|
82
|
+
});
|
|
83
|
+
exports.listValue = listValue;
|
|
84
|
+
const nullValue = () => ({
|
|
85
|
+
kind: 'NullValue',
|
|
86
|
+
});
|
|
87
|
+
exports.nullValue = nullValue;
|
|
88
|
+
const fragmentDefinition = ({ name, typeCondition, directives = [], selectionSet, }) => ({
|
|
89
|
+
kind: 'FragmentDefinition',
|
|
90
|
+
name: {
|
|
91
|
+
kind: 'Name',
|
|
92
|
+
value: name,
|
|
93
|
+
},
|
|
94
|
+
typeCondition,
|
|
95
|
+
directives,
|
|
96
|
+
selectionSet,
|
|
97
|
+
});
|
|
98
|
+
exports.fragmentDefinition = fragmentDefinition;
|
|
99
|
+
const objectField = ({ name, value }) => ({
|
|
100
|
+
kind: 'ObjectField',
|
|
101
|
+
name: {
|
|
102
|
+
kind: 'Name',
|
|
103
|
+
value: name,
|
|
104
|
+
},
|
|
105
|
+
value,
|
|
106
|
+
});
|
|
107
|
+
exports.objectField = objectField;
|
|
108
|
+
const field = ({ name, args = [], directives = [], selectionSet, }) => ({
|
|
109
|
+
kind: 'Field',
|
|
110
|
+
name: {
|
|
111
|
+
kind: 'Name',
|
|
112
|
+
value: name,
|
|
113
|
+
},
|
|
114
|
+
arguments: args,
|
|
115
|
+
directives,
|
|
116
|
+
selectionSet,
|
|
117
|
+
});
|
|
118
|
+
exports.field = field;
|
|
119
|
+
const argument = ({ name, value }) => ({
|
|
120
|
+
kind: 'Argument',
|
|
121
|
+
name: {
|
|
122
|
+
kind: 'Name',
|
|
123
|
+
value: name,
|
|
124
|
+
},
|
|
125
|
+
value,
|
|
126
|
+
});
|
|
127
|
+
exports.argument = argument;
|
package/package.json
CHANGED
|
@@ -1,66 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gql-ast",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "GraphQL ASTs",
|
|
3
|
+
"version": "2.0.2",
|
|
5
4
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
|
-
"
|
|
5
|
+
"description": "GraphQL ASTs",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"module": "esm/index.js",
|
|
8
|
+
"types": "index.d.ts",
|
|
9
|
+
"homepage": "https://github.com/launchql/launchql",
|
|
7
10
|
"license": "SEE LICENSE IN LICENSE",
|
|
8
|
-
"main": "main/index.js",
|
|
9
|
-
"module": "module/index.js",
|
|
10
|
-
"directories": {
|
|
11
|
-
"lib": "src",
|
|
12
|
-
"test": "__tests__"
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"main",
|
|
16
|
-
"module"
|
|
17
|
-
],
|
|
18
11
|
"publishConfig": {
|
|
19
|
-
"access": "public"
|
|
12
|
+
"access": "public",
|
|
13
|
+
"directory": "dist"
|
|
20
14
|
},
|
|
21
15
|
"repository": {
|
|
22
16
|
"type": "git",
|
|
23
|
-
"url": "https://github.com/launchql/launchql
|
|
17
|
+
"url": "https://github.com/launchql/launchql"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/launchql/launchql/issues"
|
|
24
21
|
},
|
|
25
22
|
"scripts": {
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"build": "npm run build:module && npm run build:main",
|
|
29
|
-
"clean": "rimraf node_modules main module",
|
|
23
|
+
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
|
|
24
|
+
"clean": "rimraf dist/**",
|
|
30
25
|
"prepare": "npm run build",
|
|
31
|
-
"
|
|
26
|
+
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
|
|
27
|
+
"build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
|
|
28
|
+
"lint": "eslint . --fix",
|
|
32
29
|
"test": "jest",
|
|
33
|
-
"test:watch": "jest --watch"
|
|
34
|
-
"test:debug": "node --inspect node_modules/.bin/jest --runInBand"
|
|
35
|
-
},
|
|
36
|
-
"bugs": {
|
|
37
|
-
"url": "https://github.com/launchql/launchql-gen/issues"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@babel/cli": "7.8.4",
|
|
41
|
-
"@babel/core": "7.8.4",
|
|
42
|
-
"@babel/plugin-proposal-class-properties": "7.8.3",
|
|
43
|
-
"@babel/plugin-proposal-export-default-from": "7.8.3",
|
|
44
|
-
"@babel/plugin-proposal-object-rest-spread": "7.9.6",
|
|
45
|
-
"@babel/plugin-transform-runtime": "7.9.6",
|
|
46
|
-
"@babel/preset-env": "7.13.0",
|
|
47
|
-
"@babel/preset-react": "7.9.4",
|
|
48
|
-
"babel-core": "7.0.0-bridge.0",
|
|
49
|
-
"babel-eslint": "10.0.3",
|
|
50
|
-
"babel-plugin-macros": "2.8.0",
|
|
51
|
-
"eslint": "^6.8.0",
|
|
52
|
-
"eslint-config-prettier": "^6.10.0",
|
|
53
|
-
"eslint-config-react-app": "5.2.0",
|
|
54
|
-
"eslint-plugin-prettier": "^3.1.2",
|
|
55
|
-
"eslint-plugin-react": "^7.18.3",
|
|
56
|
-
"eslint-plugin-react-hooks": "4.0.0",
|
|
57
|
-
"jest": "^25.1.0",
|
|
58
|
-
"prettier": "^1.19.1",
|
|
59
|
-
"regenerator-runtime": "^0.13.2",
|
|
60
|
-
"rimraf": "^3.0.2"
|
|
30
|
+
"test:watch": "jest --watch"
|
|
61
31
|
},
|
|
62
32
|
"dependencies": {
|
|
63
|
-
"
|
|
33
|
+
"graphql": "15.5.2"
|
|
64
34
|
},
|
|
65
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "d4ef195aec8d4c5a470f507b5a57c6c8e81124f4"
|
|
66
36
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [0.1.9](https://github.com/launchql/launchql-gen/compare/gql-ast@0.1.8...gql-ast@0.1.9) (2021-05-06)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package gql-ast
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## [0.1.8](https://github.com/launchql/launchql-gen/compare/gql-ast@0.1.7...gql-ast@0.1.8) (2021-03-04)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package gql-ast
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## [0.1.7](https://github.com/launchql/launchql-gen/compare/gql-ast@0.1.6...gql-ast@0.1.7) (2021-03-04)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package gql-ast
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## [0.1.6](https://github.com/launchql/launchql-gen/compare/gql-ast@0.1.5...gql-ast@0.1.6) (2021-03-04)
|
|
31
|
-
|
|
32
|
-
**Note:** Version bump only for package gql-ast
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## [0.1.5](https://github.com/launchql/launchql-gen/compare/gql-ast@0.1.4...gql-ast@0.1.5) (2021-03-04)
|
|
39
|
-
|
|
40
|
-
**Note:** Version bump only for package gql-ast
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## [0.1.4](https://github.com/launchql/launchql-gen/compare/gql-ast@0.1.3...gql-ast@0.1.4) (2021-03-04)
|
|
47
|
-
|
|
48
|
-
**Note:** Version bump only for package gql-ast
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
## [0.1.3](https://github.com/launchql/launchql-gen/compare/gql-ast@0.1.2...gql-ast@0.1.3) (2021-02-11)
|
|
55
|
-
|
|
56
|
-
**Note:** Version bump only for package gql-ast
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
## [0.1.2](https://github.com/launchql/launchql-gen/compare/gql-ast@0.1.1...gql-ast@0.1.2) (2021-02-11)
|
|
63
|
-
|
|
64
|
-
**Note:** Version bump only for package gql-ast
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
## 0.1.1 (2021-02-11)
|
|
71
|
-
|
|
72
|
-
**Note:** Version bump only for package gql-ast
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
# [0.3.0](https://github.com/pyramation/launchql-gen/compare/@pyramation/graphql-ast@0.2.0...@pyramation/graphql-ast@0.3.0) (2021-02-10)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
### Features
|
|
82
|
-
|
|
83
|
-
* **ast:** add more ast types ([858d57a](https://github.com/pyramation/launchql-gen/commit/858d57a22b3434f4db19f7ff7ce0af615b888aaa))
|
|
84
|
-
* **graphile-client:** new client API ([31daebb](https://github.com/pyramation/launchql-gen/commit/31daebb63fbcc1c70d27102dba9ff57a66cd2cb9))
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
# [0.2.0](https://github.com/pyramation/launchql-gen/compare/@pyramation/graphql-ast@0.1.1...@pyramation/graphql-ast@0.2.0) (2021-01-09)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
### Features
|
|
94
|
-
|
|
95
|
-
* **ast:** add intValue type ([bf57504](https://github.com/pyramation/launchql-gen/commit/bf575040d8f0974d9cc69a98710c3ab89d37ad97))
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
## [0.1.1](https://github.com/pyramation/launchql-gen/compare/@pyramation/graphql-ast@0.1.0...@pyramation/graphql-ast@0.1.1) (2020-10-17)
|
|
102
|
-
|
|
103
|
-
**Note:** Version bump only for package @pyramation/graphql-ast
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
# [0.1.0](https://github.com/pyramation/launchql-gen/compare/@pyramation/graphql-ast@0.0.3...@pyramation/graphql-ast@0.1.0) (2020-10-05)
|
|
110
|
-
|
|
111
|
-
**Note:** Version bump only for package @pyramation/graphql-ast
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
## [0.0.3](https://github.com/pyramation/launchql-gen/compare/@pyramation/graphql-ast@0.0.2...@pyramation/graphql-ast@0.0.3) (2020-09-04)
|
|
118
|
-
|
|
119
|
-
**Note:** Version bump only for package @pyramation/graphql-ast
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
## 0.0.2 (2020-09-04)
|
|
126
|
-
|
|
127
|
-
**Note:** Version bump only for package @pyramation/graphql-ast
|
package/main/index.js
DELETED
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.argument = exports.field = exports.objectField = exports.fragmentDefinition = exports.nullValue = exports.listValue = exports.booleanValue = exports.intValue = exports.stringValue = exports.objectValue = exports.variable = exports.namedType = exports.nonNullType = exports.listType = exports.selectionSet = exports.variableDefinition = exports.operationDefinition = exports.document = void 0;
|
|
7
|
-
|
|
8
|
-
var document = function document(_ref) {
|
|
9
|
-
var definitions = _ref.definitions;
|
|
10
|
-
return {
|
|
11
|
-
kind: 'Document',
|
|
12
|
-
definitions: definitions
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.document = document;
|
|
17
|
-
|
|
18
|
-
var operationDefinition = function operationDefinition(_ref2) {
|
|
19
|
-
var operation = _ref2.operation,
|
|
20
|
-
name = _ref2.name,
|
|
21
|
-
_ref2$variableDefinit = _ref2.variableDefinitions,
|
|
22
|
-
variableDefinitions = _ref2$variableDefinit === void 0 ? [] : _ref2$variableDefinit,
|
|
23
|
-
_ref2$directives = _ref2.directives,
|
|
24
|
-
directives = _ref2$directives === void 0 ? [] : _ref2$directives,
|
|
25
|
-
selectionSet = _ref2.selectionSet;
|
|
26
|
-
return {
|
|
27
|
-
kind: 'OperationDefinition',
|
|
28
|
-
operation: operation,
|
|
29
|
-
name: {
|
|
30
|
-
kind: 'Name',
|
|
31
|
-
value: name
|
|
32
|
-
},
|
|
33
|
-
variableDefinitions: variableDefinitions,
|
|
34
|
-
directives: directives,
|
|
35
|
-
selectionSet: selectionSet
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
exports.operationDefinition = operationDefinition;
|
|
40
|
-
|
|
41
|
-
var variableDefinition = function variableDefinition(_ref3) {
|
|
42
|
-
var variable = _ref3.variable,
|
|
43
|
-
type = _ref3.type,
|
|
44
|
-
directives = _ref3.directives;
|
|
45
|
-
return {
|
|
46
|
-
kind: 'VariableDefinition',
|
|
47
|
-
variable: variable,
|
|
48
|
-
type: type,
|
|
49
|
-
directives: directives
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
exports.variableDefinition = variableDefinition;
|
|
54
|
-
|
|
55
|
-
var selectionSet = function selectionSet(_ref4) {
|
|
56
|
-
var selections = _ref4.selections;
|
|
57
|
-
return {
|
|
58
|
-
kind: 'SelectionSet',
|
|
59
|
-
selections: selections
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
exports.selectionSet = selectionSet;
|
|
64
|
-
|
|
65
|
-
var listType = function listType(_ref5) {
|
|
66
|
-
var type = _ref5.type;
|
|
67
|
-
return {
|
|
68
|
-
kind: 'ListType',
|
|
69
|
-
type: type
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
exports.listType = listType;
|
|
74
|
-
|
|
75
|
-
var nonNullType = function nonNullType(_ref6) {
|
|
76
|
-
var type = _ref6.type;
|
|
77
|
-
return {
|
|
78
|
-
kind: 'NonNullType',
|
|
79
|
-
type: type
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
exports.nonNullType = nonNullType;
|
|
84
|
-
|
|
85
|
-
var namedType = function namedType(_ref7) {
|
|
86
|
-
var type = _ref7.type;
|
|
87
|
-
return {
|
|
88
|
-
kind: 'NamedType',
|
|
89
|
-
name: {
|
|
90
|
-
kind: 'Name',
|
|
91
|
-
value: type
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
exports.namedType = namedType;
|
|
97
|
-
|
|
98
|
-
var variable = function variable(_ref8) {
|
|
99
|
-
var name = _ref8.name;
|
|
100
|
-
return {
|
|
101
|
-
kind: 'Variable',
|
|
102
|
-
name: {
|
|
103
|
-
kind: 'Name',
|
|
104
|
-
value: name
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
exports.variable = variable;
|
|
110
|
-
|
|
111
|
-
var objectValue = function objectValue(_ref9) {
|
|
112
|
-
var fields = _ref9.fields;
|
|
113
|
-
return {
|
|
114
|
-
kind: 'ObjectValue',
|
|
115
|
-
fields: fields
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
exports.objectValue = objectValue;
|
|
120
|
-
|
|
121
|
-
var stringValue = function stringValue(_ref10) {
|
|
122
|
-
var value = _ref10.value;
|
|
123
|
-
return {
|
|
124
|
-
kind: 'StringValue',
|
|
125
|
-
value: value
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
exports.stringValue = stringValue;
|
|
130
|
-
|
|
131
|
-
var intValue = function intValue(_ref11) {
|
|
132
|
-
var value = _ref11.value;
|
|
133
|
-
return {
|
|
134
|
-
kind: 'IntValue',
|
|
135
|
-
value: value
|
|
136
|
-
};
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
exports.intValue = intValue;
|
|
140
|
-
|
|
141
|
-
var booleanValue = function booleanValue(_ref12) {
|
|
142
|
-
var value = _ref12.value;
|
|
143
|
-
return {
|
|
144
|
-
kind: 'BooleanValue',
|
|
145
|
-
value: value
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
exports.booleanValue = booleanValue;
|
|
150
|
-
|
|
151
|
-
var listValue = function listValue(_ref13) {
|
|
152
|
-
var values = _ref13.values;
|
|
153
|
-
return {
|
|
154
|
-
kind: 'ListValue',
|
|
155
|
-
values: values
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
exports.listValue = listValue;
|
|
160
|
-
|
|
161
|
-
var nullValue = function nullValue() {
|
|
162
|
-
return {
|
|
163
|
-
kind: 'NullValue'
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
exports.nullValue = nullValue;
|
|
168
|
-
|
|
169
|
-
var fragmentDefinition = function fragmentDefinition(_ref14) {
|
|
170
|
-
var name = _ref14.name,
|
|
171
|
-
typeCondition = _ref14.typeCondition,
|
|
172
|
-
directives = _ref14.directives,
|
|
173
|
-
selectionSet = _ref14.selectionSet;
|
|
174
|
-
return {
|
|
175
|
-
kind: 'FragmentDefinition',
|
|
176
|
-
name: {
|
|
177
|
-
kind: 'Name',
|
|
178
|
-
value: name
|
|
179
|
-
},
|
|
180
|
-
typeCondition: typeCondition,
|
|
181
|
-
directives: directives,
|
|
182
|
-
selectionSet: selectionSet
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
exports.fragmentDefinition = fragmentDefinition;
|
|
187
|
-
|
|
188
|
-
var objectField = function objectField(_ref15) {
|
|
189
|
-
var name = _ref15.name,
|
|
190
|
-
value = _ref15.value;
|
|
191
|
-
return {
|
|
192
|
-
kind: 'ObjectField',
|
|
193
|
-
name: {
|
|
194
|
-
kind: 'Name',
|
|
195
|
-
value: name
|
|
196
|
-
},
|
|
197
|
-
value: value
|
|
198
|
-
};
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
exports.objectField = objectField;
|
|
202
|
-
|
|
203
|
-
var field = function field(_ref16) {
|
|
204
|
-
var name = _ref16.name,
|
|
205
|
-
args = _ref16.args,
|
|
206
|
-
directives = _ref16.directives,
|
|
207
|
-
selectionSet = _ref16.selectionSet;
|
|
208
|
-
return {
|
|
209
|
-
kind: 'Field',
|
|
210
|
-
name: {
|
|
211
|
-
kind: 'Name',
|
|
212
|
-
value: name
|
|
213
|
-
},
|
|
214
|
-
arguments: args,
|
|
215
|
-
directives: directives,
|
|
216
|
-
selectionSet: selectionSet
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
exports.field = field;
|
|
221
|
-
|
|
222
|
-
var argument = function argument(_ref17) {
|
|
223
|
-
var name = _ref17.name,
|
|
224
|
-
value = _ref17.value;
|
|
225
|
-
return {
|
|
226
|
-
kind: 'Argument',
|
|
227
|
-
name: {
|
|
228
|
-
kind: 'Name',
|
|
229
|
-
value: name
|
|
230
|
-
},
|
|
231
|
-
value: value
|
|
232
|
-
};
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
exports.argument = argument;
|
package/module/index.js
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
export const document = ({
|
|
2
|
-
definitions
|
|
3
|
-
}) => ({
|
|
4
|
-
kind: 'Document',
|
|
5
|
-
definitions
|
|
6
|
-
});
|
|
7
|
-
export const operationDefinition = ({
|
|
8
|
-
operation,
|
|
9
|
-
name,
|
|
10
|
-
variableDefinitions = [],
|
|
11
|
-
directives = [],
|
|
12
|
-
selectionSet
|
|
13
|
-
}) => ({
|
|
14
|
-
kind: 'OperationDefinition',
|
|
15
|
-
operation,
|
|
16
|
-
name: {
|
|
17
|
-
kind: 'Name',
|
|
18
|
-
value: name
|
|
19
|
-
},
|
|
20
|
-
variableDefinitions,
|
|
21
|
-
directives,
|
|
22
|
-
selectionSet
|
|
23
|
-
});
|
|
24
|
-
export const variableDefinition = ({
|
|
25
|
-
variable,
|
|
26
|
-
type,
|
|
27
|
-
directives
|
|
28
|
-
}) => ({
|
|
29
|
-
kind: 'VariableDefinition',
|
|
30
|
-
variable,
|
|
31
|
-
type,
|
|
32
|
-
directives
|
|
33
|
-
});
|
|
34
|
-
export const selectionSet = ({
|
|
35
|
-
selections
|
|
36
|
-
}) => ({
|
|
37
|
-
kind: 'SelectionSet',
|
|
38
|
-
selections
|
|
39
|
-
});
|
|
40
|
-
export const listType = ({
|
|
41
|
-
type
|
|
42
|
-
}) => ({
|
|
43
|
-
kind: 'ListType',
|
|
44
|
-
type
|
|
45
|
-
});
|
|
46
|
-
export const nonNullType = ({
|
|
47
|
-
type
|
|
48
|
-
}) => ({
|
|
49
|
-
kind: 'NonNullType',
|
|
50
|
-
type
|
|
51
|
-
});
|
|
52
|
-
export const namedType = ({
|
|
53
|
-
type
|
|
54
|
-
}) => ({
|
|
55
|
-
kind: 'NamedType',
|
|
56
|
-
name: {
|
|
57
|
-
kind: 'Name',
|
|
58
|
-
value: type
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
export const variable = ({
|
|
62
|
-
name
|
|
63
|
-
}) => ({
|
|
64
|
-
kind: 'Variable',
|
|
65
|
-
name: {
|
|
66
|
-
kind: 'Name',
|
|
67
|
-
value: name
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
export const objectValue = ({
|
|
71
|
-
fields
|
|
72
|
-
}) => ({
|
|
73
|
-
kind: 'ObjectValue',
|
|
74
|
-
fields
|
|
75
|
-
});
|
|
76
|
-
export const stringValue = ({
|
|
77
|
-
value
|
|
78
|
-
}) => ({
|
|
79
|
-
kind: 'StringValue',
|
|
80
|
-
value
|
|
81
|
-
});
|
|
82
|
-
export const intValue = ({
|
|
83
|
-
value
|
|
84
|
-
}) => ({
|
|
85
|
-
kind: 'IntValue',
|
|
86
|
-
value
|
|
87
|
-
});
|
|
88
|
-
export const booleanValue = ({
|
|
89
|
-
value
|
|
90
|
-
}) => ({
|
|
91
|
-
kind: 'BooleanValue',
|
|
92
|
-
value
|
|
93
|
-
});
|
|
94
|
-
export const listValue = ({
|
|
95
|
-
values
|
|
96
|
-
}) => ({
|
|
97
|
-
kind: 'ListValue',
|
|
98
|
-
values
|
|
99
|
-
});
|
|
100
|
-
export const nullValue = () => ({
|
|
101
|
-
kind: 'NullValue'
|
|
102
|
-
});
|
|
103
|
-
export const fragmentDefinition = ({
|
|
104
|
-
name,
|
|
105
|
-
typeCondition,
|
|
106
|
-
directives,
|
|
107
|
-
selectionSet
|
|
108
|
-
}) => ({
|
|
109
|
-
kind: 'FragmentDefinition',
|
|
110
|
-
name: {
|
|
111
|
-
kind: 'Name',
|
|
112
|
-
value: name
|
|
113
|
-
},
|
|
114
|
-
typeCondition,
|
|
115
|
-
directives,
|
|
116
|
-
selectionSet
|
|
117
|
-
});
|
|
118
|
-
export const objectField = ({
|
|
119
|
-
name,
|
|
120
|
-
value
|
|
121
|
-
}) => ({
|
|
122
|
-
kind: 'ObjectField',
|
|
123
|
-
name: {
|
|
124
|
-
kind: 'Name',
|
|
125
|
-
value: name
|
|
126
|
-
},
|
|
127
|
-
value
|
|
128
|
-
});
|
|
129
|
-
export const field = ({
|
|
130
|
-
name,
|
|
131
|
-
args,
|
|
132
|
-
directives,
|
|
133
|
-
selectionSet
|
|
134
|
-
}) => ({
|
|
135
|
-
kind: 'Field',
|
|
136
|
-
name: {
|
|
137
|
-
kind: 'Name',
|
|
138
|
-
value: name
|
|
139
|
-
},
|
|
140
|
-
arguments: args,
|
|
141
|
-
directives,
|
|
142
|
-
selectionSet
|
|
143
|
-
});
|
|
144
|
-
export const argument = ({
|
|
145
|
-
name,
|
|
146
|
-
value
|
|
147
|
-
}) => ({
|
|
148
|
-
kind: 'Argument',
|
|
149
|
-
name: {
|
|
150
|
-
kind: 'Name',
|
|
151
|
-
value: name
|
|
152
|
-
},
|
|
153
|
-
value
|
|
154
|
-
});
|