Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GQL code example incomplete #405

Closed
KingNoosh opened this issue Mar 17, 2021 · 2 comments · Fixed by #417
Closed

GQL code example incomplete #405

KingNoosh opened this issue Mar 17, 2021 · 2 comments · Fixed by #417

Comments

@KingNoosh
Copy link

KingNoosh commented Mar 17, 2021

@Injectable()
export class GqlThrottlerGuard extends ThrottlerGuard {
  getRequestResponse(context: ExecutionContext) {
    const gqlCtx = GqlExecutionContext.create(context);
    const ctx = gql.getContext();
    return { req, ctx.req, res: ctx.res }; // ctx.request and ctx.reply for fastify
  }
}

Where is the request pulled from? Where does gqlCtx get used? What is the gql variable as it's undefined anyways.

The code example is quite literally useless, the docs may as well point to documentation about getRequestResponse.

@jmcdo29
Copy link
Member

jmcdo29 commented Mar 17, 2021

Apologies, the nest docs got updated, but I missed updating the README for this. I'll get that fixed shortly

@KingNoosh
Copy link
Author

Cheers, I'll leave this ticket for you to close.

@jmcdo29 jmcdo29 linked a pull request Mar 24, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants