Skip to content

Setting GraphQL depth limit to 10#109

Open
TomHawk123 wants to merge 1 commit intoroostorg:mainfrom
TomHawk123:mac-graphql_depth_limiter
Open

Setting GraphQL depth limit to 10#109
TomHawk123 wants to merge 1 commit intoroostorg:mainfrom
TomHawk123:mac-graphql_depth_limiter

Conversation

@TomHawk123
Copy link

Context & Requests for Reviewers

This PR answers Issue #108

Tests

Ran locally and slammed the server with an overly complex query to confirm crashing of service. Implemented depth limit of 10 and tested:

Expected to Fail:

curl -s -X POST http://localhost:8080/graphql \
  -H 'Content-Type: application/json' \
  -d '{"query":"{ jobs { edges { node { item { submittedBy { roles { org { policies { rules { conditions { id } } } } } } } } } } }"}' \
  | jq .

Expected to Succeed:

curl -s -X POST http://localhost:8080/graphql \
  -H 'Content-Type: application/json' \
  -d '{"query":"{ __typename }"}' \
  | jq .

(Optional) Rollout Plan

After testing by reviewers, this should be able to rollout immediately.

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 this pull request may close these issues.

1 participant