Skip to content

Commit ab49682

Browse files
committed
refactor: migrate code to lib src/
1 parent 0056d91 commit ab49682

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+237
-433
lines changed

example/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"main": "index.js",
55
"license": "MIT",
66
"dependencies": {
7-
"apollo-server": "^2.11.0",
8-
"bullmq": "^1.8.4",
9-
"graphql": "^14.6.0",
10-
"graphql-compose": "^7.14.0"
7+
"apollo-server": "^2.11.0"
118
},
129
"devDependencies": {
1310
"ts-node-dev": "^1.0.0-pre.44"
1411
},
12+
"resolutions": {
13+
"graphql": "link:../node_modules/graphql"
14+
},
1515
"scripts": {
1616
"watch": "ts-node-dev ./src/index.ts --no-notify",
1717
"tscheck": "../node_modules/.bin/tsc --noEmit",

example/src/demo_queues/fetchMetrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { BULL_REDIS_URI, BULL_HOST_ID } from '../config';
22
import { Queue, Worker, QueueScheduler } from 'bullmq';
3-
import { createBullConnection } from '../connectRedis';
3+
import { createBullConnection } from '../../../src/connectRedis';
44

55
if (!BULL_REDIS_URI) {
66
throw new Error(`Env var BULL_REDIS_URI is empty. Cannot init task ${__filename}.`);

example/src/schema.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { composeBull } from '../../src';
2+
import { schemaComposer } from 'graphql-compose';
3+
4+
const { queryFields, mutationFields } = composeBull({
5+
schemaComposer,
6+
typePrefix: 'Prefix',
7+
jobDataTC: `type MyJobData { fieldA: String! fieldB: String}`,
8+
});
9+
10+
schemaComposer.Query.addFields({
11+
...queryFields,
12+
});
13+
14+
schemaComposer.Mutation.addFields({
15+
...mutationFields,
16+
});
17+
18+
export default schemaComposer.buildSchema();

example/src/schema/index.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

example/src/schema/mutation/helpers/wrapMutationFC.ts

Lines changed: 0 additions & 89 deletions
This file was deleted.

example/src/schema/mutation/index.ts

Lines changed: 0 additions & 54 deletions
This file was deleted.

example/src/schema/query/index.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

example/src/schema/snippets.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

example/tsconfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
"compilerOptions": {
33
"target": "es5",
44
"module": "commonjs",
5+
"noEmit": true,
56
"strict": true,
67
"declaration": true,
78
"declarationMap": true,
8-
"rootDir": "./src",
9-
"outDir": "./lib",
9+
"rootDir": "../",
10+
"outDir": "./example/dist",
1011
"lib": ["esnext"],
1112
"moduleResolution": "node",
1213
"esModuleInterop": true,
1314
"forceConsistentCasingInFileNames": true,
1415
"noImplicitAny": false,
1516
"types": ["node", "jest"]
1617
},
17-
"include": ["src/**/*.ts", "*.js"]
18+
"include": ["./example/src/**/*.ts", "./src"]
1819
}

0 commit comments

Comments
 (0)