File tree Expand file tree Collapse file tree 2 files changed +35
-6
lines changed Expand file tree Collapse file tree 2 files changed +35
-6
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,17 @@ export const GRAPHILE_WORKER_TOKEN = Symbol.for('NestJsGraphileWorker');
15
15
export class GraphileWorkerModule {
16
16
/**
17
17
* Registers a globally available `GraphileWorkerService`.
18
+ *
19
+ * Example:
20
+ *
21
+ * ```ts
22
+ * GraphileWorkerModule.forRoot({
23
+ * connectionString: 'postgres://example:password@postgres /example',
24
+ * taskList: {
25
+ * hello: helloTask,
26
+ * },
27
+ * }),
28
+ * ```
18
29
*/
19
30
static forRoot ( config : GraphileWorkerConfiguration ) : DynamicModule {
20
31
const graphileWorkerService : Provider = {
@@ -30,6 +41,24 @@ export class GraphileWorkerModule {
30
41
} ;
31
42
}
32
43
44
+ /**
45
+ * Registers a globally available `GraphileWorkerService`.
46
+ *
47
+ * Example:
48
+ *
49
+ * ```ts
50
+ * GraphileWorkerModule.forRootAsync({
51
+ * imports: [ConfigModule],
52
+ * inject: [ConfigService],
53
+ * useFactory: (config: ConfigService) => ({
54
+ * connectionString: config.get('PG_CONNECTION'),
55
+ * taskList: {
56
+ * hello: helloTask,
57
+ * },
58
+ * }),
59
+ * }),
60
+ * ```
61
+ */
33
62
static forRootAsync (
34
63
asyncConfig : GraphileWorkerAsyncConfiguration ,
35
64
) : DynamicModule {
Original file line number Diff line number Diff line change @@ -6,12 +6,12 @@ import { helloTask } from './hello.task';
6
6
7
7
@Module ( {
8
8
imports : [
9
- // GraphileWorkerModule.forRoot({
10
- // connectionString: 'postgres://example:password@postgres/example',
11
- // taskList: {
12
- // hello: helloTask,
13
- // },
14
- // }),
9
+ GraphileWorkerModule . forRoot ( {
10
+ connectionString : 'postgres://example:password@postgres/example' ,
11
+ taskList : {
12
+ hello : helloTask ,
13
+ } ,
14
+ } ) ,
15
15
ConfigModule . forRoot ( ) ,
16
16
GraphileWorkerModule . forRootAsync ( {
17
17
imports : [ ConfigModule ] ,
You can’t perform that action at this time.
0 commit comments