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
- Host: GitHub
- URL: https://github.com/digicatapult/graphql-complexity-experiment
- Owner: digicatapult
- License: apache-2.0
- Archived: true
- Created: 2020-01-24T11:45:21.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-03-14T10:24:54.000Z (almost 2 years ago)
- Last Synced: 2024-08-04T01:27:22.491Z (over 1 year ago)
- Language: JavaScript
- Size: 590 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - graphql-complexity-experiment - query-complexity on apollo-server-express | digicatapult | 3 | (JavaScript)
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)