Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

feat(hardening): limits query depth #89

Closed
wants to merge 1 commit into from

Conversation

ojongerius
Copy link
Contributor

@ojongerius ojongerius commented Apr 30, 2018

Addresses #25 This will limit the query depth to 10, see https://github.com/stems/graphql-depth-limit for more information.

Once we have types contain references to each other people could create cyclical queries like the following:

query evil {
  album(id: 42) {
    songs {
      album {
        songs {
          album {
            songs {
              album {
                songs {
                  album {
                    songs {
                      album {
                        songs {
                          album {
                            # and so on...
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

@ojongerius
Copy link
Contributor Author

@freeCodeCamp/open-api time to review?

@Bouncey
Copy link
Member

Bouncey commented May 1, 2018

It is hard to review against code that doesn't exist. I understand the need for this, but we also need something is test against.

This will be more suited for when we have event types where you can possibly traverse queries like event -> attendees -> events -> attendees ...and so on.

@ojongerius
Copy link
Contributor Author

@Bouncey this is true. Do you have any user stories open that would warrant having this in so I can link to this?

@ojongerius ojongerius mentioned this pull request May 2, 2018
@Bouncey
Copy link
Member

Bouncey commented May 2, 2018

None for learn, I haven't looked at events yet though.

@ojongerius
Copy link
Contributor Author

Can be resurrected when working on freeCodeCamp/events#8

@ojongerius ojongerius closed this May 3, 2018
@ojongerius ojongerius mentioned this pull request May 25, 2018
4 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants