@hazeljs/graphql 0.2.0-alpha.1
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 +192 -0
- package/README.md +124 -0
- package/dist/client/decorators.d.ts +44 -0
- package/dist/client/decorators.d.ts.map +1 -0
- package/dist/client/decorators.js +72 -0
- package/dist/client/decorators.test.d.ts +2 -0
- package/dist/client/decorators.test.d.ts.map +1 -0
- package/dist/client/decorators.test.js +102 -0
- package/dist/client/graphql.client.d.ts +25 -0
- package/dist/client/graphql.client.d.ts.map +1 -0
- package/dist/client/graphql.client.js +47 -0
- package/dist/client/graphql.client.test.d.ts +2 -0
- package/dist/client/graphql.client.test.d.ts.map +1 -0
- package/dist/client/graphql.client.test.js +79 -0
- package/dist/decorators/field.decorator.d.ts +23 -0
- package/dist/decorators/field.decorator.d.ts.map +1 -0
- package/dist/decorators/field.decorator.js +37 -0
- package/dist/decorators/field.decorator.test.d.ts +2 -0
- package/dist/decorators/field.decorator.test.d.ts.map +1 -0
- package/dist/decorators/field.decorator.test.js +67 -0
- package/dist/decorators/object-type.decorator.d.ts +21 -0
- package/dist/decorators/object-type.decorator.d.ts.map +1 -0
- package/dist/decorators/object-type.decorator.js +34 -0
- package/dist/decorators/object-type.decorator.test.d.ts +2 -0
- package/dist/decorators/object-type.decorator.test.d.ts.map +1 -0
- package/dist/decorators/object-type.decorator.test.js +45 -0
- package/dist/decorators/query-mutation.decorator.d.ts +25 -0
- package/dist/decorators/query-mutation.decorator.d.ts.map +1 -0
- package/dist/decorators/query-mutation.decorator.js +62 -0
- package/dist/decorators/query-mutation.decorator.test.d.ts +2 -0
- package/dist/decorators/query-mutation.decorator.test.d.ts.map +1 -0
- package/dist/decorators/query-mutation.decorator.test.js +176 -0
- package/dist/decorators/resolver.decorator.d.ts +25 -0
- package/dist/decorators/resolver.decorator.d.ts.map +1 -0
- package/dist/decorators/resolver.decorator.js +35 -0
- package/dist/decorators/resolver.decorator.test.d.ts +2 -0
- package/dist/decorators/resolver.decorator.test.d.ts.map +1 -0
- package/dist/decorators/resolver.decorator.test.js +36 -0
- package/dist/graphql.module.d.ts +31 -0
- package/dist/graphql.module.d.ts.map +1 -0
- package/dist/graphql.module.js +63 -0
- package/dist/graphql.module.test.d.ts +2 -0
- package/dist/graphql.module.test.d.ts.map +1 -0
- package/dist/graphql.module.test.js +85 -0
- package/dist/graphql.server.d.ts +34 -0
- package/dist/graphql.server.d.ts.map +1 -0
- package/dist/graphql.server.js +74 -0
- package/dist/graphql.server.test.d.ts +2 -0
- package/dist/graphql.server.test.d.ts.map +1 -0
- package/dist/graphql.server.test.js +79 -0
- package/dist/graphql.types.d.ts +36 -0
- package/dist/graphql.types.d.ts.map +1 -0
- package/dist/graphql.types.js +5 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/schema-builder.d.ts +9 -0
- package/dist/schema-builder.d.ts.map +1 -0
- package/dist/schema-builder.js +142 -0
- package/dist/schema-builder.test.d.ts +2 -0
- package/dist/schema-builder.test.d.ts.map +1 -0
- package/dist/schema-builder.test.js +182 -0
- package/package.json +56 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SchemaBuilder = void 0;
|
|
7
|
+
const graphql_1 = require("graphql");
|
|
8
|
+
const core_1 = __importDefault(require("@hazeljs/core"));
|
|
9
|
+
const object_type_decorator_1 = require("./decorators/object-type.decorator");
|
|
10
|
+
const field_decorator_1 = require("./decorators/field.decorator");
|
|
11
|
+
const query_mutation_decorator_1 = require("./decorators/query-mutation.decorator");
|
|
12
|
+
const resolver_decorator_1 = require("./decorators/resolver.decorator");
|
|
13
|
+
const SCALAR_MAP = {
|
|
14
|
+
String: graphql_1.GraphQLString,
|
|
15
|
+
Number: graphql_1.GraphQLFloat,
|
|
16
|
+
number: graphql_1.GraphQLFloat,
|
|
17
|
+
Boolean: graphql_1.GraphQLBoolean,
|
|
18
|
+
boolean: graphql_1.GraphQLBoolean,
|
|
19
|
+
Int: graphql_1.GraphQLInt,
|
|
20
|
+
Float: graphql_1.GraphQLFloat,
|
|
21
|
+
ID: graphql_1.GraphQLID,
|
|
22
|
+
};
|
|
23
|
+
class SchemaBuilder {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.objectTypeCache = new Map();
|
|
26
|
+
}
|
|
27
|
+
buildSchema(resolvers, container) {
|
|
28
|
+
const queryFields = {};
|
|
29
|
+
const mutationFields = {};
|
|
30
|
+
for (const ResolverClass of resolvers) {
|
|
31
|
+
void (0, resolver_decorator_1.getResolverMetadata)(ResolverClass);
|
|
32
|
+
const instance = container.resolve(ResolverClass);
|
|
33
|
+
const queries = (0, query_mutation_decorator_1.getQueryMetadata)(ResolverClass);
|
|
34
|
+
for (const q of queries) {
|
|
35
|
+
const args = {};
|
|
36
|
+
const argMeta = (0, query_mutation_decorator_1.getArgMetadata)(ResolverClass.prototype, q.method);
|
|
37
|
+
for (const a of argMeta.filter(Boolean)) {
|
|
38
|
+
args[a.name] = { type: this.inferType(a.type) };
|
|
39
|
+
}
|
|
40
|
+
queryFields[q.name] = {
|
|
41
|
+
type: this.inferType(undefined),
|
|
42
|
+
args,
|
|
43
|
+
resolve: (_, args) => {
|
|
44
|
+
const method = instance[q.method];
|
|
45
|
+
if (typeof method !== 'function') {
|
|
46
|
+
core_1.default.warn(`Query handler ${q.method} not found on ${ResolverClass.name}`);
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const orderedArgs = argMeta.map((a) => (a ? args[a.name] : undefined));
|
|
50
|
+
return method.apply(instance, orderedArgs);
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const mutations = (0, query_mutation_decorator_1.getMutationMetadata)(ResolverClass);
|
|
55
|
+
for (const m of mutations) {
|
|
56
|
+
const args = {};
|
|
57
|
+
const argMeta = (0, query_mutation_decorator_1.getArgMetadata)(ResolverClass.prototype, m.method);
|
|
58
|
+
for (const a of argMeta.filter(Boolean)) {
|
|
59
|
+
args[a.name] = { type: this.inferType(a.type) };
|
|
60
|
+
}
|
|
61
|
+
mutationFields[m.name] = {
|
|
62
|
+
type: this.inferType(undefined),
|
|
63
|
+
args,
|
|
64
|
+
resolve: (_, args) => {
|
|
65
|
+
const method = instance[m.method];
|
|
66
|
+
if (typeof method !== 'function') {
|
|
67
|
+
core_1.default.warn(`Mutation handler ${m.method} not found on ${ResolverClass.name}`);
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
const orderedArgs = argMeta.map((a) => (a ? args[a.name] : undefined));
|
|
71
|
+
return method.apply(instance, orderedArgs);
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const queryType = new graphql_1.GraphQLObjectType({
|
|
77
|
+
name: 'Query',
|
|
78
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
79
|
+
fields: () => queryFields,
|
|
80
|
+
});
|
|
81
|
+
const mutationType = Object.keys(mutationFields).length > 0
|
|
82
|
+
? new graphql_1.GraphQLObjectType({
|
|
83
|
+
name: 'Mutation',
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
85
|
+
fields: () => mutationFields,
|
|
86
|
+
})
|
|
87
|
+
: undefined;
|
|
88
|
+
return new graphql_1.GraphQLSchema({
|
|
89
|
+
query: queryType,
|
|
90
|
+
...(mutationType && { mutation: mutationType }),
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
inferType(tsType, nullable = true) {
|
|
94
|
+
if (tsType === undefined || tsType === null)
|
|
95
|
+
return graphql_1.GraphQLString;
|
|
96
|
+
const type = tsType;
|
|
97
|
+
const name = type?.name || String(tsType);
|
|
98
|
+
if (name.endsWith('[]') || name === 'Array') {
|
|
99
|
+
const inner = this.inferType({ name: name.replace('[]', '') });
|
|
100
|
+
return nullable
|
|
101
|
+
? new graphql_1.GraphQLList(inner)
|
|
102
|
+
: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(inner));
|
|
103
|
+
}
|
|
104
|
+
const scalar = SCALAR_MAP[name];
|
|
105
|
+
if (scalar)
|
|
106
|
+
return nullable ? scalar : new graphql_1.GraphQLNonNull(scalar);
|
|
107
|
+
const objMeta = type?.prototype && (0, object_type_decorator_1.getObjectTypeMetadata)(type.prototype);
|
|
108
|
+
if (objMeta) {
|
|
109
|
+
let objType = this.objectTypeCache.get(type.prototype);
|
|
110
|
+
if (!objType) {
|
|
111
|
+
objType = this.buildObjectType(type);
|
|
112
|
+
this.objectTypeCache.set(type.prototype, objType);
|
|
113
|
+
}
|
|
114
|
+
return nullable ? objType : new graphql_1.GraphQLNonNull(objType);
|
|
115
|
+
}
|
|
116
|
+
return graphql_1.GraphQLString;
|
|
117
|
+
}
|
|
118
|
+
buildObjectType(cls) {
|
|
119
|
+
const meta = (0, object_type_decorator_1.getObjectTypeMetadata)(cls.prototype) || { name: cls.name };
|
|
120
|
+
const fieldsMeta = (0, field_decorator_1.getFieldMetadata)(cls.prototype) || [];
|
|
121
|
+
const fields = {};
|
|
122
|
+
for (const f of fieldsMeta) {
|
|
123
|
+
if (!f)
|
|
124
|
+
continue;
|
|
125
|
+
fields[f.name] = {
|
|
126
|
+
type: this.inferType(f.type),
|
|
127
|
+
resolve: (source) => {
|
|
128
|
+
const val = source?.[f.name];
|
|
129
|
+
if (typeof val === 'function')
|
|
130
|
+
return val.call(source);
|
|
131
|
+
return val;
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
return new graphql_1.GraphQLObjectType({
|
|
136
|
+
name: meta.name,
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
138
|
+
fields: () => fields,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
exports.SchemaBuilder = SchemaBuilder;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-builder.test.d.ts","sourceRoot":"","sources":["../src/schema-builder.test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
45
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
require("reflect-metadata");
|
|
49
|
+
const core_1 = require("@hazeljs/core");
|
|
50
|
+
const core_2 = require("@hazeljs/core");
|
|
51
|
+
const schema_builder_1 = require("./schema-builder");
|
|
52
|
+
const resolver_decorator_1 = require("./decorators/resolver.decorator");
|
|
53
|
+
const query_mutation_decorator_1 = require("./decorators/query-mutation.decorator");
|
|
54
|
+
let TestResolver = class TestResolver {
|
|
55
|
+
hello() {
|
|
56
|
+
return 'world';
|
|
57
|
+
}
|
|
58
|
+
user(id) {
|
|
59
|
+
return JSON.stringify({ id, name: `User ${id}` });
|
|
60
|
+
}
|
|
61
|
+
createUser(name) {
|
|
62
|
+
return JSON.stringify({ id: '1', name });
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, query_mutation_decorator_1.Query)(),
|
|
67
|
+
__metadata("design:type", Function),
|
|
68
|
+
__metadata("design:paramtypes", []),
|
|
69
|
+
__metadata("design:returntype", void 0)
|
|
70
|
+
], TestResolver.prototype, "hello", null);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, query_mutation_decorator_1.Query)(),
|
|
73
|
+
__param(0, (0, query_mutation_decorator_1.Arg)('id')),
|
|
74
|
+
__metadata("design:type", Function),
|
|
75
|
+
__metadata("design:paramtypes", [String]),
|
|
76
|
+
__metadata("design:returntype", void 0)
|
|
77
|
+
], TestResolver.prototype, "user", null);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, query_mutation_decorator_1.Mutation)(),
|
|
80
|
+
__param(0, (0, query_mutation_decorator_1.Arg)('name')),
|
|
81
|
+
__metadata("design:type", Function),
|
|
82
|
+
__metadata("design:paramtypes", [String]),
|
|
83
|
+
__metadata("design:returntype", void 0)
|
|
84
|
+
], TestResolver.prototype, "createUser", null);
|
|
85
|
+
TestResolver = __decorate([
|
|
86
|
+
(0, core_2.Injectable)(),
|
|
87
|
+
(0, resolver_decorator_1.Resolver)()
|
|
88
|
+
], TestResolver);
|
|
89
|
+
describe('SchemaBuilder', () => {
|
|
90
|
+
let container;
|
|
91
|
+
beforeEach(() => {
|
|
92
|
+
container = core_1.Container.createTestInstance();
|
|
93
|
+
container.register(TestResolver, new TestResolver());
|
|
94
|
+
});
|
|
95
|
+
it('should build schema with queries', () => {
|
|
96
|
+
const builder = new schema_builder_1.SchemaBuilder();
|
|
97
|
+
const schema = builder.buildSchema([TestResolver], container);
|
|
98
|
+
expect(schema.getQueryType()).toBeDefined();
|
|
99
|
+
expect(schema.getQueryType()?.getFields().hello).toBeDefined();
|
|
100
|
+
expect(schema.getQueryType()?.getFields().user).toBeDefined();
|
|
101
|
+
});
|
|
102
|
+
it('should build schema with mutations', () => {
|
|
103
|
+
const builder = new schema_builder_1.SchemaBuilder();
|
|
104
|
+
const schema = builder.buildSchema([TestResolver], container);
|
|
105
|
+
expect(schema.getMutationType()).toBeDefined();
|
|
106
|
+
expect(schema.getMutationType()?.getFields().createUser).toBeDefined();
|
|
107
|
+
});
|
|
108
|
+
it('should execute query resolvers', async () => {
|
|
109
|
+
const builder = new schema_builder_1.SchemaBuilder();
|
|
110
|
+
const schema = builder.buildSchema([TestResolver], container);
|
|
111
|
+
const { graphql } = await Promise.resolve().then(() => __importStar(require('graphql')));
|
|
112
|
+
const result = await graphql({ schema, source: '{ hello }' });
|
|
113
|
+
expect(result.data).toEqual({ hello: 'world' });
|
|
114
|
+
});
|
|
115
|
+
it('should execute query with args', async () => {
|
|
116
|
+
const builder = new schema_builder_1.SchemaBuilder();
|
|
117
|
+
const schema = builder.buildSchema([TestResolver], container);
|
|
118
|
+
const { graphql } = await Promise.resolve().then(() => __importStar(require('graphql')));
|
|
119
|
+
const result = await graphql({ schema, source: '{ user(id: "42") }' });
|
|
120
|
+
expect(result.errors).toBeUndefined();
|
|
121
|
+
expect(result.data?.user).toBeDefined();
|
|
122
|
+
expect(JSON.parse(result.data.user)).toMatchObject({ id: '42', name: 'User 42' });
|
|
123
|
+
});
|
|
124
|
+
it('should execute mutation', async () => {
|
|
125
|
+
const builder = new schema_builder_1.SchemaBuilder();
|
|
126
|
+
const schema = builder.buildSchema([TestResolver], container);
|
|
127
|
+
const { graphql } = await Promise.resolve().then(() => __importStar(require('graphql')));
|
|
128
|
+
const result = await graphql({
|
|
129
|
+
schema,
|
|
130
|
+
source: 'mutation { createUser(name: "Alice") }',
|
|
131
|
+
});
|
|
132
|
+
expect(result.errors).toBeUndefined();
|
|
133
|
+
expect(result.data?.createUser).toBeDefined();
|
|
134
|
+
expect(JSON.parse(result.data.createUser)).toMatchObject({ id: '1', name: 'Alice' });
|
|
135
|
+
});
|
|
136
|
+
it('should handle resolver with missing method', async () => {
|
|
137
|
+
let IncompleteResolver = class IncompleteResolver {
|
|
138
|
+
hello() {
|
|
139
|
+
return 'ok';
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, query_mutation_decorator_1.Query)(),
|
|
144
|
+
__metadata("design:type", Function),
|
|
145
|
+
__metadata("design:paramtypes", []),
|
|
146
|
+
__metadata("design:returntype", void 0)
|
|
147
|
+
], IncompleteResolver.prototype, "hello", null);
|
|
148
|
+
IncompleteResolver = __decorate([
|
|
149
|
+
(0, core_2.Injectable)(),
|
|
150
|
+
(0, resolver_decorator_1.Resolver)()
|
|
151
|
+
], IncompleteResolver);
|
|
152
|
+
const instance = new (class {
|
|
153
|
+
})();
|
|
154
|
+
container.register(IncompleteResolver, instance);
|
|
155
|
+
const builder = new schema_builder_1.SchemaBuilder();
|
|
156
|
+
const schema = builder.buildSchema([IncompleteResolver], container);
|
|
157
|
+
const { graphql } = await Promise.resolve().then(() => __importStar(require('graphql')));
|
|
158
|
+
const result = await graphql({ schema, source: '{ hello }' });
|
|
159
|
+
expect(result.data?.hello).toBeNull();
|
|
160
|
+
});
|
|
161
|
+
it('should build mutation type only when mutations exist', () => {
|
|
162
|
+
let QueryOnlyResolver = class QueryOnlyResolver {
|
|
163
|
+
only() {
|
|
164
|
+
return 'ok';
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
__decorate([
|
|
168
|
+
(0, query_mutation_decorator_1.Query)(),
|
|
169
|
+
__metadata("design:type", Function),
|
|
170
|
+
__metadata("design:paramtypes", []),
|
|
171
|
+
__metadata("design:returntype", void 0)
|
|
172
|
+
], QueryOnlyResolver.prototype, "only", null);
|
|
173
|
+
QueryOnlyResolver = __decorate([
|
|
174
|
+
(0, core_2.Injectable)(),
|
|
175
|
+
(0, resolver_decorator_1.Resolver)()
|
|
176
|
+
], QueryOnlyResolver);
|
|
177
|
+
container.register(QueryOnlyResolver, new QueryOnlyResolver());
|
|
178
|
+
const builder = new schema_builder_1.SchemaBuilder();
|
|
179
|
+
const schema = builder.buildSchema([QueryOnlyResolver], container);
|
|
180
|
+
expect(schema.getMutationType()).toBeUndefined();
|
|
181
|
+
});
|
|
182
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hazeljs/graphql",
|
|
3
|
+
"version": "0.2.0-alpha.1",
|
|
4
|
+
"description": "GraphQL server and client for HazelJS - decorator-based schema and typed client",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc --skipLibCheck",
|
|
12
|
+
"test": "jest --coverage --passWithNoTests",
|
|
13
|
+
"lint": "eslint \"src/**/*.ts\"",
|
|
14
|
+
"lint:fix": "eslint \"src/**/*.ts\" --fix",
|
|
15
|
+
"clean": "rm -rf dist"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"graphql": "^16.9.0",
|
|
19
|
+
"graphql-http": "^1.22.4"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^20.17.50",
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "^8.18.2",
|
|
24
|
+
"@typescript-eslint/parser": "^8.18.2",
|
|
25
|
+
"eslint": "^8.56.0",
|
|
26
|
+
"jest": "^29.7.0",
|
|
27
|
+
"ts-jest": "^29.1.2",
|
|
28
|
+
"typescript": "^5.3.3"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@hazeljs/core": ">=0.2.0-beta.0"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "git+https://github.com/hazel-js/hazeljs.git",
|
|
39
|
+
"directory": "packages/graphql"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [
|
|
42
|
+
"hazeljs",
|
|
43
|
+
"graphql",
|
|
44
|
+
"decorators",
|
|
45
|
+
"schema",
|
|
46
|
+
"client",
|
|
47
|
+
"server"
|
|
48
|
+
],
|
|
49
|
+
"author": "Muhammad Arslan <muhammad.arslan@hazeljs.com>",
|
|
50
|
+
"license": "Apache-2.0",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/hazeljs/hazel-js/issues"
|
|
53
|
+
},
|
|
54
|
+
"homepage": "https://hazeljs.com",
|
|
55
|
+
"gitHead": "cbc5ee2c12ced28fd0576faf13c5f078c1e8421e"
|
|
56
|
+
}
|