From 41fb2c4effdb2db7f77f450055f901ed1b428e75 Mon Sep 17 00:00:00 2001 From: Tim Ermilov Date: Tue, 6 Oct 2020 15:10:04 +0200 Subject: [PATCH] Replace fastify-gql with mercurius (lib rename) --- docs/FAQ.md | 2 +- packages/graffiti/CHANGELOG.md | 4 + packages/graffiti/lib/index.js | 2 +- packages/graffiti/package.json | 4 +- yarn.lock | 136 ++++++++++++++++++++++++--------- 5 files changed, 107 insertions(+), 41 deletions(-) diff --git a/docs/FAQ.md b/docs/FAQ.md index cf1fc33..f1ba13d 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -7,5 +7,5 @@ Yes! If you find any issues - please [create a new ticket](https://github.com/ya ## How does it work? Graffiti uses [graphql-compose](https://graphql-compose.github.io/) along with [graphql-compose-mongoose](https://graphql-compose.github.io/docs/plugins/plugin-mongoose.html) and [Mongoose](https://mongoosejs.com/) to automatically generate GraphQL schema from files you create. -It then uses [fastify](https://www.fastify.io/) together with [fastify-gql](https://github.com/mcollina/fastify-gql) to create GraphQL API from generated schema. +It then uses [fastify](https://www.fastify.io/) together with [mercurius](https://github.com/mercurius-js/mercurius) to create GraphQL API from generated schema. All the GraphQL configuration of your projects happens automatically based on file structures, exposed schema definitions and helper functions. diff --git a/packages/graffiti/CHANGELOG.md b/packages/graffiti/CHANGELOG.md index c1f45cf..0159b8b 100644 --- a/packages/graffiti/CHANGELOG.md +++ b/packages/graffiti/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.1.2 / 2020-10-06 + +- Replace fastify-gql with mercurius (was renamed) + # 1.1.1 / 2020-09-16 - Fix playground credentials setting diff --git a/packages/graffiti/lib/index.js b/packages/graffiti/lib/index.js index 7871f92..e6d1ce4 100644 --- a/packages/graffiti/lib/index.js +++ b/packages/graffiti/lib/index.js @@ -1,5 +1,5 @@ const fastify = require('fastify'); -const GQL = require('fastify-gql'); +const GQL = require('mercurius'); const { buildSchema } = require('./graphql'); const { loadPlugins } = require('./plugins'); const { connect } = require('./mongoose'); diff --git a/packages/graffiti/package.json b/packages/graffiti/package.json index 83e99ee..7a980bb 100644 --- a/packages/graffiti/package.json +++ b/packages/graffiti/package.json @@ -1,6 +1,6 @@ { "name": "graffiti", - "version": "1.1.1", + "version": "1.1.2", "description": "Minimalistic GraphQL framework", "repository": "yamalight/graffiti", "bugs": "https://github.com/yamalight/graffiti/issues", @@ -24,11 +24,11 @@ "license": "MIT", "dependencies": { "fastify": "^3.3.0", - "fastify-gql": "^5.7.0", "graphql": "^15.3.0", "graphql-compose": "^7.19.4", "graphql-compose-mongoose": "^8.0.2", "lodash": "^4.17.20", + "mercurius": "^6.0.0", "mongoose": "^5.10.0", "nodemon": "^2.0.4", "pino-pretty": "^4.2.1" diff --git a/yarn.lock b/yarn.lock index 79390ad..8b03100 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3323,7 +3323,7 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.17.0, es-abstract@^1.17.0-next.1, es-abstract@^1.17.4, es-abstract@^1.17.5: +es-abstract@^1.17.0, es-abstract@^1.17.0-next.1, es-abstract@^1.17.5: version "1.17.6" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.6.tgz#9142071707857b2cacc7b89ecb670316c3e2d52a" integrity sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw== @@ -3340,6 +3340,41 @@ es-abstract@^1.17.0, es-abstract@^1.17.0-next.1, es-abstract@^1.17.4, es-abstrac string.prototype.trimend "^1.0.1" string.prototype.trimstart "^1.0.1" +es-abstract@^1.17.4: + version "1.17.7" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.7.tgz#a4de61b2f66989fc7421676c1cb9787573ace54c" + integrity sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + +es-abstract@^1.18.0-next.0: + version "1.18.0-next.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" + integrity sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-negative-zero "^2.0.0" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + es-array-method-boxes-properly@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" @@ -3852,27 +3887,6 @@ fastify-error@^0.2.0: resolved "https://registry.yarnpkg.com/fastify-error/-/fastify-error-0.2.0.tgz#9a1c28d4f42b6259e7a549671c8e5e2d85660634" integrity sha512-zabxsBatj59ROG0fhP36zNdc5Q1/eYeH9oSF9uvfrurZf8/JKfrJbMcIGrLpLWcf89rS6L91RHWm20A/X85hcA== -fastify-gql@^5.7.0: - version "5.7.0" - resolved "https://registry.yarnpkg.com/fastify-gql/-/fastify-gql-5.7.0.tgz#1766f53c0eda5f60537633881217d046ccabad6c" - integrity sha512-nS3Qf2ZGfTL29nDkhPozOnnsnz2tM5/w53Z/JxIMqcw4c+e5qQKASI5MHqVt/ME5y/8KRZwzLy9nPtxEHeFJHQ== - dependencies: - end-of-stream "^1.4.4" - events.on "^1.0.1" - fastify-plugin "^2.0.1" - fastify-static "^3.0.0" - fastify-websocket "^2.0.5" - graphql "^15.0.0" - graphql-jit "^0.4.0" - http-errors "^1.7.3" - mqemitter "^4.0.0" - p-map "^4.0.0" - promise.allsettled "^1.0.2" - readable-stream "^3.5.0" - single-user-cache "^0.3.0" - tiny-lru "^7.0.2" - ws "^7.2.1" - fastify-jwt@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/fastify-jwt/-/fastify-jwt-2.1.3.tgz#d016a2f6a810299edc72ad79ce2949fb88a20604" @@ -3884,19 +3898,26 @@ fastify-jwt@^2.1.3: jsonwebtoken "^8.3.0" steed "^1.1.3" -fastify-plugin@^2.0.0, fastify-plugin@^2.0.1, fastify-plugin@^2.3.3: +fastify-plugin@^2.0.0, fastify-plugin@^2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/fastify-plugin/-/fastify-plugin-2.3.3.tgz#795ad6d00ffb08d5c0af51edecd25dee4c668b42" integrity sha512-KjVwrTlbOGBLhF80tAYQ8qXQKvc1G7ETlFZbU4n19V1Xoo9BRNQgicv36y9AvPDcIn1hpeHDOdpPkMW02NOVIQ== dependencies: semver "^7.3.2" +fastify-plugin@^2.0.1, fastify-plugin@^2.3.4: + version "2.3.4" + resolved "https://registry.yarnpkg.com/fastify-plugin/-/fastify-plugin-2.3.4.tgz#b17abdc36a97877d88101fb86ad8a07f2c07de87" + integrity sha512-I+Oaj6p9oiRozbam30sh39BiuiqBda7yK2nmSPVwDCfIBlKnT8YB3MY+pRQc2Fcd07bf6KPGklHJaQ2Qu81TYQ== + dependencies: + semver "^7.3.2" + fastify-static@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/fastify-static/-/fastify-static-3.2.0.tgz#1c5f433274b310b1c82de6870cc8f4206cedb2bc" - integrity sha512-gaN4AX1CrlhwC3cApS1uDSZOkQSbhxt32MRCjlJL3dhG7pxAIf69fmSS1nrKtZe69b5HRn/KyEqkh9qzLN8GZw== + version "3.2.1" + resolved "https://registry.yarnpkg.com/fastify-static/-/fastify-static-3.2.1.tgz#9dc699b45788f8ec861bc1205b3b745653d2c9ea" + integrity sha512-5l4pTKstyawqXW0dfTwhOS91WNiI9Dr6fwSHnBMv/lNIeGjH6SMKU+5Ypf9DrgLI3N75e7fkmrYhL5tT/BwQZA== dependencies: - fastify-plugin "^2.0.0" + fastify-plugin "^2.3.4" glob "^7.1.4" readable-stream "^3.4.0" send "^0.17.1" @@ -3907,13 +3928,13 @@ fastify-warning@^0.2.0: integrity sha512-s1EQguBw/9qtc1p/WTY4eq9WMRIACkj+HTcOIK1in4MV5aFaQC9ZCIt0dJ7pr5bIf4lPpHvAtP2ywpTNgs7hqw== fastify-websocket@^2.0.5: - version "2.0.7" - resolved "https://registry.yarnpkg.com/fastify-websocket/-/fastify-websocket-2.0.7.tgz#3e51415dfa1245cee630c633a21f78d55ed80b91" - integrity sha512-N8fP9Fbwpv1L1Zv0Hk+r7/ep6mD49BZeyFIC1ffErD5oHogEpEkwDBJxcloGGb6c+zhMu1ZS0ymYdrguI4+MrA== + version "2.0.8" + resolved "https://registry.yarnpkg.com/fastify-websocket/-/fastify-websocket-2.0.8.tgz#77d465473b32c70faa04d206774ffe66c6f6f9b9" + integrity sha512-nXXroRv7rQo95aJb6fIXJjpWSB6HRSW1IDFmyKHYZaNDwSovSO+Fc5c5V7SCsYaVDwnTS0chmbtVg1cuWv45Dg== dependencies: - fastify-plugin "^2.0.0" - find-my-way "^3.0.0" - ws "^7.2.3" + fastify-plugin "^2.3.4" + find-my-way "^3.0.4" + ws "^7.3.1" fastify@^3.3.0: version "3.3.0" @@ -4025,7 +4046,7 @@ find-cache-dir@^2.1.0: make-dir "^2.0.0" pkg-dir "^3.0.0" -find-my-way@^3.0.0: +find-my-way@^3.0.0, find-my-way@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/find-my-way/-/find-my-way-3.0.4.tgz#a485973d1a3fdafd989ac9f12fd2d88e83cda268" integrity sha512-Trl/mNAVvTgCpo9ox6yixkwiZUvecKYUQZoAuMCBACsgGqv+FbWe+jE5sBA5+U8LIWrJk/cw8zPV53GPrjTnsw== @@ -4755,6 +4776,11 @@ is-callable@^1.1.4, is-callable@^1.2.0: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.0.tgz#83336560b54a38e35e3a2df7afd0454d691468bb" integrity sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw== +is-callable@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" + integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA== + is-ci@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" @@ -4870,6 +4896,11 @@ is-map@^2.0.1: resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.1.tgz#520dafc4307bb8ebc33b813de5ce7c9400d644a1" integrity sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw== +is-negative-zero@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.0.tgz#9553b121b0fac28869da9ed459e20c7543788461" + integrity sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE= + is-npm@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d" @@ -4914,7 +4945,7 @@ is-property@^1.0.2: resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" integrity sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ= -is-regex@^1.1.0: +is-regex@^1.1.0, is-regex@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== @@ -5934,6 +5965,27 @@ memory-pager@^1.0.2: resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.5.0.tgz#d8751655d22d384682741c972f2c3d6dfa3e66b5" integrity sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg== +mercurius@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/mercurius/-/mercurius-6.0.0.tgz#be84bfbb51b7423080547de7cfc0292dec7e22f4" + integrity sha512-txocOnVv0UlmG3VbmzzRuRx+Ra8LM7vHzBQuYR0cj1bpsN1wkcMLvHjNW93UoJ9By+mK63gEvqwtXIhnFeqb8w== + dependencies: + end-of-stream "^1.4.4" + events.on "^1.0.1" + fastify-plugin "^2.0.1" + fastify-static "^3.0.0" + fastify-websocket "^2.0.5" + graphql "^15.0.0" + graphql-jit "^0.4.0" + http-errors "^1.7.3" + mqemitter "^4.0.0" + p-map "^4.0.0" + promise.allsettled "^1.0.2" + readable-stream "^3.5.0" + single-user-cache "^0.3.0" + tiny-lru "^7.0.2" + ws "^7.2.1" + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -6585,7 +6637,7 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-inspect@^1.7.0: +object-inspect@^1.7.0, object-inspect@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.8.0.tgz#df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0" integrity sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA== @@ -6617,6 +6669,16 @@ object.assign@^4.1.0: has-symbols "^1.0.0" object-keys "^1.0.11" +object.assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.1.tgz#303867a666cdd41936ecdedfb1f8f3e32a478cdd" + integrity sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.18.0-next.0" + has-symbols "^1.0.1" + object-keys "^1.1.1" + object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" @@ -9212,7 +9274,7 @@ write@1.0.3: dependencies: mkdirp "^0.5.1" -ws@^7.2.1, ws@^7.2.3: +ws@^7.2.1, ws@^7.2.3, ws@^7.3.1: version "7.3.1" resolved "https://registry.yarnpkg.com/ws/-/ws-7.3.1.tgz#d0547bf67f7ce4f12a72dfe31262c68d7dc551c8" integrity sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==