An open API service indexing awesome lists of open source software.

https://github.com/digicatapult/graphql-complexity-experiment

Demonstrator of graphql-query-complexity on apollo-server-express
https://github.com/digicatapult/graphql-complexity-experiment

Last synced: 8 months ago
JSON representation

Demonstrator of graphql-query-complexity on apollo-server-express

Awesome Lists containing this project

README

          

# GraphQL Complexity Experiment

## Deprecation Notice
This application was deprecated on March 14th 2024, there will be no further dependency or security updates.
---

This repo contains demonstration code for using the module [`graphql-query-complexity`](https://github.com/slicknode/graphql-query-complexity) with [`Apollo Server`](https://github.com/apollographql/apollo-server) in order to constrain the query complexity accepted by a GraphQL API to prevent DoS type attacks. This is heavily inspired by the example given in [`MichalLytek/type-graphql`](https://github.com/MichalLytek/type-graphql/tree/master/examples/query-complexity).

## Running the example

The example can be run with:

```console
npm start
```

and viewed at the graphql playground at [http://localhost:3000/graphql](http://localhost:3000/graphql)