diff --git a/.changeset/angry-rats-allow.md b/.changeset/angry-rats-allow.md deleted file mode 100644 index d59c172..0000000 --- a/.changeset/angry-rats-allow.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -'graphql-no-alias': major ---- - -Implement imperative configuration - -With imperative configuration, there is no need for type definition and schema modification. - -```ts -const permissions = { - Query: { - '*': 2, // default value for all queries - getAnotherUser: 5 // custom value for specific query - }, - Mutation: { - '*': 1 //default value for all mutations - } -} -const { validation } = createValidation({ permissions }) - -const schema = buildSchema(/* GraphQL */ ` - type Query { - getUser: User - getAnotherUser: User - } - type User { - name: String - } -`) -``` - -When the `permissions` key is passed to configuration, schema directives will be ignored. diff --git a/.changeset/friendly-rivers-walk.md b/.changeset/friendly-rivers-walk.md deleted file mode 100644 index 3fd8a79..0000000 --- a/.changeset/friendly-rivers-walk.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'graphql-no-alias': major ---- - -Change function signature, make it use a single config object diff --git a/CHANGELOG.md b/CHANGELOG.md index 793d458..d9b8728 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,40 @@ # graphql-no-alias +## 2.0.0 + +### Major Changes + +- dc1d95f: Implement imperative configuration + + With imperative configuration, there is no need for type definition and schema modification. + + ```ts + const permissions = { + Query: { + '*': 2, // default value for all queries + getAnotherUser: 5 // custom value for specific query + }, + Mutation: { + '*': 1 //default value for all mutations + } + } + const { validation } = createValidation({ permissions }) + + const schema = buildSchema(/* GraphQL */ ` + type Query { + getUser: User + getAnotherUser: User + } + type User { + name: String + } + `) + ``` + + When the `permissions` key is passed to configuration, schema directives will be ignored. + +- fccb773: Change function signature, make it use a single config object + ## 1.0.1 ### Patch Changes diff --git a/package.json b/package.json index 99ead70..52c5530 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "graphql-no-alias", - "version": "1.0.1", + "version": "2.0.0", "private": false, "description": "No alias directive for graphql mutation and query types. It can limit the amount of alias fields that can be used for queries and mutations. Preventing batch attacks.", "keywords": [