@nestjs/graphql
Version:
Nest - modern, fast, powerful node.js web framework (@graphql)
22 lines (21 loc) • 597 B
JavaScript
import { ExecutionContextHost } from '@nestjs/core/helpers/execution-context-host.js';
export class GqlArgumentsHost extends ExecutionContextHost {
static create(context) {
const type = context.getType();
const gqlContext = new GqlArgumentsHost(context.getArgs());
gqlContext.setType(type);
return gqlContext;
}
getRoot() {
return this.getArgByIndex(0);
}
getArgs() {
return this.getArgByIndex(1);
}
getContext() {
return this.getArgByIndex(2);
}
getInfo() {
return this.getArgByIndex(3);
}
}