From 82a87b75c06246e5f99a3d8d43e99e886cb04b46 Mon Sep 17 00:00:00 2001 From: Mish Ushakov Date: Fri, 16 Jun 2023 15:44:45 +0200 Subject: [PATCH] Fixes: "field has a resolve property" --- package-lock.json | 4 +- package.json | 2 +- src/schema.ts | 5 ++- www/api/classes/GarphSchema.md | 38 +++++++++--------- www/api/classes/Type.md | 18 ++++----- www/api/index.md | 70 +++++++++++++++++----------------- 6 files changed, 70 insertions(+), 67 deletions(-) diff --git a/package-lock.json b/package-lock.json index f6ee869..91590a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "garph", - "version": "0.5.6", + "version": "0.5.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "garph", - "version": "0.5.6", + "version": "0.5.7", "license": "MIT", "dependencies": { "graphql-compose": "^9.0.10", diff --git a/package.json b/package.json index e0a7deb..3170548 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "git", "url": "https://github.com/stepci/garph" }, - "version": "0.5.6", + "version": "0.5.7", "license": "MIT", "main": "dist/index.js", "scripts": { diff --git a/src/schema.ts b/src/schema.ts index 916d92a..fb24938 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -157,9 +157,12 @@ export function parseFields(name: string, fields: AnyType, config: ConverterConf defaultValue: field.typeDef.defaultValue, deprecationReason: field.typeDef.deprecated, description: field.typeDef.description, - resolve: addResolver(resolvers?.[fieldName], name + '.' + fieldName), subscribe: resolvers?.[fieldName]?.subscribe } + + if (resolvers?.[fieldName]) { + fieldsObj[fieldName].resolve = addResolver(resolvers[fieldName], `${name}.${fieldName}`) + } }) return fieldsObj diff --git a/www/api/classes/GarphSchema.md b/www/api/classes/GarphSchema.md index 4559ccc..ded790c 100644 --- a/www/api/classes/GarphSchema.md +++ b/www/api/classes/GarphSchema.md @@ -16,7 +16,7 @@ #### Defined in -[index.ts:578](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L578) +[index.ts:578](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L578) ___ @@ -35,7 +35,7 @@ ___ #### Defined in -[index.ts:589](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L589) +[index.ts:589](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L589) ___ @@ -45,7 +45,7 @@ ___ #### Defined in -[index.ts:582](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L582) +[index.ts:582](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L582) ___ @@ -55,7 +55,7 @@ ___ #### Defined in -[index.ts:577](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L577) +[index.ts:577](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L577) ## Methods @@ -69,7 +69,7 @@ ___ #### Defined in -[index.ts:677](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L677) +[index.ts:677](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L677) ___ @@ -97,7 +97,7 @@ ___ #### Defined in -[index.ts:608](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L608) +[index.ts:608](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L608) ___ @@ -125,7 +125,7 @@ ___ #### Defined in -[index.ts:618](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L618) +[index.ts:618](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L618) ___ @@ -153,7 +153,7 @@ ___ #### Defined in -[index.ts:637](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L637) +[index.ts:637](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L637) ___ @@ -167,7 +167,7 @@ ___ #### Defined in -[index.ts:673](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L673) +[index.ts:673](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L673) ___ @@ -181,7 +181,7 @@ ___ #### Defined in -[index.ts:665](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L665) +[index.ts:665](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L665) ___ @@ -209,7 +209,7 @@ ___ #### Defined in -[index.ts:631](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L631) +[index.ts:631](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L631) ___ @@ -223,7 +223,7 @@ ___ #### Defined in -[index.ts:669](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L669) +[index.ts:669](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L669) ___ @@ -251,7 +251,7 @@ ___ #### Defined in -[index.ts:655](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L655) +[index.ts:655](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L655) ___ @@ -279,7 +279,7 @@ ___ #### Defined in -[index.ts:602](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L602) +[index.ts:602](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L602) ___ @@ -305,7 +305,7 @@ ___ #### Defined in -[index.ts:683](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L683) +[index.ts:683](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L683) ___ @@ -333,7 +333,7 @@ ___ #### Defined in -[index.ts:649](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L649) +[index.ts:649](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L649) ___ @@ -347,7 +347,7 @@ ___ #### Defined in -[index.ts:661](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L661) +[index.ts:661](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L661) ___ @@ -375,7 +375,7 @@ ___ #### Defined in -[index.ts:596](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L596) +[index.ts:596](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L596) ___ @@ -403,4 +403,4 @@ ___ #### Defined in -[index.ts:643](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L643) +[index.ts:643](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L643) diff --git a/www/api/classes/Type.md b/www/api/classes/Type.md index 3e60b7d..b1f7074 100644 --- a/www/api/classes/Type.md +++ b/www/api/classes/Type.md @@ -30,7 +30,7 @@ #### Defined in -[index.ts:13](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L13) +[index.ts:13](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L13) ___ @@ -40,7 +40,7 @@ ___ #### Defined in -[index.ts:11](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L11) +[index.ts:11](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L11) ___ @@ -50,7 +50,7 @@ ___ #### Defined in -[index.ts:10](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L10) +[index.ts:10](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L10) ___ @@ -60,7 +60,7 @@ ___ #### Defined in -[index.ts:9](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L9) +[index.ts:9](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L9) ___ @@ -70,7 +70,7 @@ ___ #### Defined in -[index.ts:12](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L12) +[index.ts:12](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L12) ___ @@ -80,7 +80,7 @@ ___ #### Defined in -[index.ts:14](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L14) +[index.ts:14](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L14) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[index.ts:15](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L15) +[index.ts:15](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L15) ## Methods @@ -110,7 +110,7 @@ ___ #### Defined in -[index.ts:22](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L22) +[index.ts:22](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L22) ___ @@ -130,4 +130,4 @@ ___ #### Defined in -[index.ts:17](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L17) +[index.ts:17](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L17) diff --git a/www/api/index.md b/www/api/index.md index 9d6e35f..3b3ef3f 100644 --- a/www/api/index.md +++ b/www/api/index.md @@ -15,7 +15,7 @@ garph #### Defined in -[index.ts:57](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L57) +[index.ts:57](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L57) ___ @@ -25,7 +25,7 @@ ___ #### Defined in -[index.ts:45](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L45) +[index.ts:45](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L45) ___ @@ -35,7 +35,7 @@ ___ #### Defined in -[index.ts:53](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L53) +[index.ts:53](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L53) ___ @@ -45,7 +45,7 @@ ___ #### Defined in -[index.ts:48](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L48) +[index.ts:48](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L48) ___ @@ -55,7 +55,7 @@ ___ #### Defined in -[index.ts:44](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L44) +[index.ts:44](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L44) ___ @@ -65,7 +65,7 @@ ___ #### Defined in -[index.ts:55](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L55) +[index.ts:55](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L55) ___ @@ -75,7 +75,7 @@ ___ #### Defined in -[index.ts:47](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L47) +[index.ts:47](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L47) ___ @@ -85,7 +85,7 @@ ___ #### Defined in -[index.ts:56](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L56) +[index.ts:56](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L56) ___ @@ -95,7 +95,7 @@ ___ #### Defined in -[index.ts:50](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L50) +[index.ts:50](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L50) ___ @@ -105,7 +105,7 @@ ___ #### Defined in -[index.ts:46](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L46) +[index.ts:46](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L46) ___ @@ -115,7 +115,7 @@ ___ #### Defined in -[index.ts:59](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L59) +[index.ts:59](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L59) ___ @@ -129,7 +129,7 @@ ___ #### Defined in -[index.ts:70](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L70) +[index.ts:70](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L70) ___ @@ -139,7 +139,7 @@ ___ #### Defined in -[index.ts:60](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L60) +[index.ts:60](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L60) ___ @@ -149,7 +149,7 @@ ___ #### Defined in -[index.ts:58](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L58) +[index.ts:58](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L58) ___ @@ -159,7 +159,7 @@ ___ #### Defined in -[index.ts:51](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L51) +[index.ts:51](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L51) ___ @@ -169,7 +169,7 @@ ___ #### Defined in -[index.ts:49](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L49) +[index.ts:49](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L49) ___ @@ -179,7 +179,7 @@ ___ #### Defined in -[index.ts:54](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L54) +[index.ts:54](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L54) ___ @@ -189,7 +189,7 @@ ___ #### Defined in -[index.ts:43](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L43) +[index.ts:43](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L43) ___ @@ -199,7 +199,7 @@ ___ #### Defined in -[index.ts:42](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L42) +[index.ts:42](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L42) ___ @@ -213,7 +213,7 @@ ___ #### Defined in -[index.ts:66](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L66) +[index.ts:66](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L66) ___ @@ -223,7 +223,7 @@ ___ #### Defined in -[index.ts:52](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L52) +[index.ts:52](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L52) ___ @@ -237,7 +237,7 @@ ___ #### Defined in -[index.ts:62](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L62) +[index.ts:62](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L62) ___ @@ -254,7 +254,7 @@ ___ #### Defined in -[index.ts:92](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L92) +[index.ts:92](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L92) ___ @@ -270,7 +270,7 @@ ___ #### Defined in -[index.ts:124](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L124) +[index.ts:124](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L124) ___ @@ -286,7 +286,7 @@ ___ #### Defined in -[index.ts:125](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L125) +[index.ts:125](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L125) ___ @@ -302,7 +302,7 @@ ___ #### Defined in -[index.ts:119](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L119) +[index.ts:119](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L119) ___ @@ -318,7 +318,7 @@ ___ #### Defined in -[index.ts:120](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L120) +[index.ts:120](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L120) ___ @@ -335,7 +335,7 @@ ___ #### Defined in -[index.ts:93](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L93) +[index.ts:93](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L93) ___ @@ -352,7 +352,7 @@ ___ #### Defined in -[index.ts:133](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L133) +[index.ts:133](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L133) ___ @@ -369,7 +369,7 @@ ___ #### Defined in -[index.ts:155](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L155) +[index.ts:155](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L155) ___ @@ -386,7 +386,7 @@ ___ #### Defined in -[index.ts:107](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L107) +[index.ts:107](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L107) ___ @@ -402,7 +402,7 @@ ___ #### Defined in -[index.ts:131](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L131) +[index.ts:131](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L131) ___ @@ -434,7 +434,7 @@ ___ #### Defined in -[index.ts:28](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L28) +[index.ts:28](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L28) ## Variables @@ -444,7 +444,7 @@ ___ #### Defined in -[index.ts:696](https://github.com/stepci/garph/blob/898cac6/src/index.ts#L696) +[index.ts:696](https://github.com/stepci/garph/blob/b8564e2/src/index.ts#L696) ## Functions @@ -467,4 +467,4 @@ ___ #### Defined in -[schema.ts:16](https://github.com/stepci/garph/blob/898cac6/src/schema.ts#L16) +[schema.ts:16](https://github.com/stepci/garph/blob/b8564e2/src/schema.ts#L16)