Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ivandotv committed Jan 24, 2022
1 parent f9177d4 commit 0c257d4
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 deletions.
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,26 @@
![Codecov](https://img.shields.io/codecov/c/gh/ivandotv/graphql-no-alias)
[![GitHub license](https://img.shields.io/github/license/ivandotv/graphql-no-alias)](https://github.com/ivandotv/graphql-no-alias/blob/main/LICENSE)

Graphql validation with accompanying directive to limit the number of `alias` queries and mutations you can use.
It effectively disables batching of queries and mutations.
<!-- toc -->

## Why
- [Inspiration](#inspiration)
- [Instalation](#instalation)
- [Usage](#usage)
- [Using the directive](#using-the-directive)
- [Schema setup](#schema-setup)
- [Object type](#object-type)
- [Field type](#field-type)
- [Customizing the declaration](#customizing-the-declaration)
- [Imperative configuration](#imperative-configuration)
- [Customizing the error message](#customizing-the-error-message)
- [Envelop Plugin](#envelop-plugin)
- [License](#license)

<!-- tocstop -->

## Inspiration

Graphql validation with accompanying directive to limit the number of `alias` queries and mutations that can be sent to the GraphQL server.

It will disable certain kinds of attacks that look like this.

Expand Down Expand Up @@ -239,6 +255,10 @@ const { typeDefs, validation } = createValidation({errorFn:(
})
```

## Envelop Plugin

If you are using [GraphQL Envelop](https://www.envelop.dev/). I have made a (plugin)[packages/envelop/README.md] that uses this directive.

### License

This project is licensed under the MIT License - see [LICENSE](LICENSE) file for details
8 changes: 8 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ coverage:
target: auto
flags:
- graphql-no-alias
envelop:
target: auto
flags:
- envelop

comment:
layout: 'reach, diff, flags, files'
Expand All @@ -20,3 +24,7 @@ flags:
paths:
- packages/graphql-no-alias/
carryforward: true
envelop:
paths:
- packages/envelop/
carryforward: true
29 changes: 29 additions & 0 deletions packages/envelop/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
// "lib": ["ESNext"],
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"stripInternal": true,
"esModuleInterop": true,
"skipDefaultLibCheck": false,
"skipLibCheck": false,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"isolatedModules": true,
"incremental": true,
"jsx": "preserve"
},
"include": ["packages/no-alias/src/**/*"],
"exclude": [
"**/node_modules",
"packages/no-alias/src/**/__tests__",
"packages/no-alias/src/**/*.test.ts",
"packages/no-alias/src/**/*.spec.ts"
]
}

0 comments on commit 0c257d4

Please sign in to comment.