1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.GqlExecutionContext = void 0;
|
4 | const execution_context_host_1 = require("@nestjs/core/helpers/execution-context-host");
|
5 | const normalize_resolver_args_1 = require("../utils/normalize-resolver-args");
|
6 | class GqlExecutionContext extends execution_context_host_1.ExecutionContextHost {
|
7 | static create(context) {
|
8 | const type = context.getType();
|
9 | const gqlContext = new GqlExecutionContext((0, normalize_resolver_args_1.normalizeResolverArgs)(context.getArgs()), context.getClass(), context.getHandler());
|
10 | gqlContext.setType(type);
|
11 | return gqlContext;
|
12 | }
|
13 | getType() {
|
14 | return super.getType();
|
15 | }
|
16 | getRoot() {
|
17 | return this.getArgByIndex(0);
|
18 | }
|
19 | getArgs() {
|
20 | return this.getArgByIndex(1);
|
21 | }
|
22 | getContext() {
|
23 | return this.getArgByIndex(2);
|
24 | }
|
25 | getInfo() {
|
26 | return this.getArgByIndex(3);
|
27 | }
|
28 | }
|
29 | exports.GqlExecutionContext = GqlExecutionContext;
|