Skip to content

GraphQL Query Depth Limiting #50

Answered by enisdenjo
4815162342 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey there, I've just released v1.14.0 with #51 that simplifies this process. You can add the depth limit validation rule from the graphql-depth-limit package like this:

import { createHandler } from 'graphql-http';
import depthLimit from 'graphql-depth-limit';
import { schema } from './my-schema';

const handler = createHandler({
  schema,
  validationRules: [depthLimit(7)],
});

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@4815162342
Comment options

Answer selected by enisdenjo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants