From 3b83ef87e26fba9bd228febd404d0821c97f61e6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 3 Jan 2022 21:52:23 +0000 Subject: [PATCH] version bump --- .changeset/angry-rats-allow.md | 32 --------------------------- .changeset/friendly-rivers-walk.md | 5 ----- CHANGELOG.md | 35 ++++++++++++++++++++++++++++++ package.json | 2 +- 4 files changed, 36 insertions(+), 38 deletions(-) delete mode 100644 .changeset/angry-rats-allow.md delete mode 100644 .changeset/friendly-rivers-walk.md 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": [