Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hey everyone - like a few others, I'm migrating my express GraphQL servers from the express-graphql package to this. One thing I really enjoyed was the drop-in package graphql-depth-limit that allowed for quick validation against unbounded query depths.

Is anyone aware of a similar solution for this package? Or an easy way to adapt that one for graphql-http? Thanks in advance!

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

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)],
});
You must be logged in to vote
1 reply
@4815162342
Comment options

@enisdenjo thank you so much! That's a huge help.

And thanks overall for maintaining this open source package! It's devs like you who keep the industry moving forward :)

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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.