{"_id":"@giraphql/plugin-errors","_rev":"43-427c5ec619c48d078bf77609186c2132","name":"@giraphql/plugin-errors","dist-tags":{"latest":"2.13.0","preview":"0.0.0-preview-202172534216"},"versions":{"2.1.0-alpha.0":{"name":"@giraphql/plugin-errors","version":"2.1.0-alpha.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.9.0-alpha.0","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"b93f5e4f5541062c8edde4b82852af5e54f91e16","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.1.0-alpha.0","_nodeVersion":"15.14.0","_npmVersion":"lerna/4.0.0/node@v15.14.0+x64 (darwin)","dist":{"integrity":"sha512-wjmJlxZRUrhIPnA3nJYgarvN6CwSjno25SrK2g5gw2g/iRbQBi92jy5H7zT5MADj3ZZuGyCUU/nyrLQ6hRfrEA==","shasum":"70d948c00962727a8eca551e483f512dd7ef5f20","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.1.0-alpha.0.tgz","fileCount":39,"unpackedSize":250598,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2SIeCRA9TVsSAnZWagAAX/EP/3bkDLHgh4YtR0lx4oW6\nSnwpldGbq5PioIq2VsFkDjvU6R2gQEBgDuOg4ZnifJT7k+IqDu0d26gIGkVN\nDKP9HGwN7kbINdWLeFf4218xDXoqixVY9g8i8cC+fjgHepEidBwu+mfDIV2w\nvCp9Z9cXgIrdeuBhyylxz+HCFH7z3KvozpK2Fh6zbAaR7cAqypLSsB/5Hwyk\nI6Icb0TO3ZJMNnB5OEB7rvCATPuoDpkW5qU3SCkmpLfJc/GimXsytEG1sPv8\nZf6KwT9M3MgwaUtl41Y7yU3hF2m8/1Xg8S8vcXGo8fyR3UbpRCZt5uc5lsq2\nY6Tc4DhxA7lt7xdNYTtC9ynkbRdU6fPJ8rsvuXe4U9EM8CG/4khfvz4+61XM\nMGl3fYqq8TA019DfyO26/kWjNOEHKNZz2mK2XRu3oLN61iD+8MAlS2K12Cx0\ngT013RNfNw3e6014i1xIPeEOWLA/HtHGAY8XjYGwQEjmEEyNf/f2gbLOs9Eg\nTreadSwpgzJZp3DJl4eFdO5DXBKp5Ly3L6l7gWkwnvYzr6cwWqn6RjMdAR8u\nVYL7sIrDw3NSm2CsReB0Gydu53V5dZ6Pha3lMUztHfu/6F9ImpyhC4AyFBcz\nQiXmsDOJXNGNo4g2A0UQ5y3MotjFDSoSZtz47K3vQxqCBtykMWhp3q3tu95v\nYVz1\r\n=gn36\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwblFaF/w4mHpz4gB61r6i/NwKmHBZAsVtaiteaxl7vgIhAMm5COM67A4ZA0Wg15mC1x7XuxjBNgAWHq2/+QARmr0T"}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.1.0-alpha.0_1624842781589_0.3365430478821503"},"_hasShrinkwrap":false},"2.1.0-alpha.1":{"name":"@giraphql/plugin-errors","version":"2.1.0-alpha.1","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.9.0-alpha.1","@giraphql/plugin-validation":"^2.5.0-alpha.0","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"042e0b1b98acbe84f4761f028eefd25d178bf736","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.1.0-alpha.1","_nodeVersion":"15.14.0","_npmVersion":"lerna/4.0.0/node@v15.14.0+x64 (darwin)","dist":{"integrity":"sha512-JLKi/FeKPzvNpcHJXPvffHhA0UZXl0N1ed9iTbWVFzjKzcLMTw8HxgNZ2lh/2+Q7x7naAJhbt0n6jg5tMqx1+w==","shasum":"b282be8a760b566640d1c056e4f6d1434f1e3be7","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.1.0-alpha.1.tgz","fileCount":39,"unpackedSize":256513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2hFzCRA9TVsSAnZWagAAN2cP/3lfu9krXmwE8eNebnxp\ndN/uhm4G87/njh6n48nziW9P1mG72wV1P4HHeTAALC3ppQbh2AvB8IzURtKy\nbWsgVOYRYkvGCQw+2UJeMzjDFgomg9yDpIcDXBjmSsGI2V1T8LGKE9y7K5mU\nA3FBbFuYa6+K8QbXDRVsfCcKQLHl3iWH7UysXXbRd7ctPObhRlpfGBvGLjZa\nOcQoCEqY1GDMNvCyJnsKzeB5xLdDr5VRBRdSL/74hz76wQb+G5I+8u52Pq5Z\nSbxqd3dS3OGB1kueemeAfeTuKqBO9vq6CfJjAwDrVkbz7Ss1BToQkxzdEBxE\npwfOw8QnZ7zpddKV6DKsB1vKiLPxp1mfyGEZamdmHhSP9MIWYF0SWP0BXHMY\nEb+6jg66AHnUcHbqN08oef/IrRDiqZOD+kYh/mqON6Dej6rSddrdL2Nr8nt4\nsQhUJnLgyvxhaJqULwZ4MiILFM9f1yZ3X/PSis0wxEySxj+EFMMIRuV2cUXf\nVkYdE0zBhNtcxTRTd9OGtmETzKmQDFbnajdJyiYIJPBwPifAeAO3TCpi8If8\nU0t/QMNMIP5QmxpCpPGwmP6XhNENCKdNzrtSpsKIiA6c33m3rodyLcgC5kAG\nF0s0kPIFFOxkqNmvGHJpHskFGHp07nfANE8jdwKaAcL+xTWKt1n3b+cWfT/a\n3Eev\r\n=m4iW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCNZch2bDUrwtystjFeytiH1p5D+LxVbyzRVdT1b9I9QIgZrqsjuNXaJs1KuBubVuoU4DvjxURnLiu1w6h/d24bzY="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.1.0-alpha.1_1624904051388_0.6256539209263414"},"_hasShrinkwrap":false},"2.1.0":{"name":"@giraphql/plugin-errors","version":"2.1.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.9.0","@giraphql/plugin-validation":"^2.5.0","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"2b03d2b65225d9c6662e41aa859729343ea24c78","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.1.0","_nodeVersion":"15.14.0","_npmVersion":"lerna/4.0.0/node@v15.14.0+x64 (darwin)","dist":{"integrity":"sha512-PcWfnCLrok5uFmzjEG2K88NjLJqIxwbmxR6DdN7uEVgieu5SZIrW3NZxv+9/QvLqeMlC3uRnguQC8FnCmV81qw==","shasum":"a852bc3172998df33b6062615f66b87a84c561e4","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.1.0.tgz","fileCount":39,"unpackedSize":256790,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2hTUCRA9TVsSAnZWagAAla0P/RYpSydZmFx1FagnUT6V\nzT5toxKz2pVKKaZfsLcmJCGZij0XK7CPbBK442ZoCzNMgW9fkVs4QHUhV1lH\nSdp/1+IV2Vgv/uMqrpnhDpNsXF/+t8obmCrVVpzX87DVOgtmYI2NRA0cYN9q\nlA4/uT+e+IR3V4blqyVnHksrXJvR3Z9TU7fzrc76tr1JB9hjkiMlVcGNu/O3\nirJi+DsbPuEakUhMekDgZ0z/DAehXhZTCzS2SMtme5lkGutMjVEwwgoMN2vS\nNEzMwO8iT+qQiexqTzUfFW+oZTYceO414dJCK0AKGSKSFxLcRjej6NoKYKMQ\n7b+sX0ssYT1807dilqWhbLAvmMbqocdTrOwckJPm517gM00W6xGVPlLhUHfv\nHCN9EI1tz4onJzkUJ4nR85hDri36nb+fSwqyybAcaj+bePktiLDzAr9gOZRn\nBTTYg2RMLRbon+OS0iaEJCK0PBjbKEHMJQ0wcru01TQSq2GtfHWth9JyvvwL\na5G6zltxg781G4GNt8Cgcwy0f2wFcr1ub9HakW7LxNEtRYaAk/5ReiYMSLkh\nlGjq8yI3pYfFssZONoE0O6AYdq2+J6N77Dgqp9QtnknMPXavp1TxeVTTyLhW\n3L3xhzeF4sFwsX2oVWuAv9wK1TIRpY2iLLkqH2JmRWNcSp5vP/0fqVeFSXU0\nBh8I\r\n=yaRR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICY3UKEPydbbYs+/RvH1k4jONFNUinDgvMDt4OCnp24XAiAQ8xrfzCeKIfLSd9lU/nzBf4dsabefCXSMr3zm9EmRNg=="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.1.0_1624904916095_0.8211124033518771"},"_hasShrinkwrap":false},"2.1.1":{"name":"@giraphql/plugin-errors","version":"2.1.1","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.9.0","@giraphql/plugin-validation":"^2.6.0","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"554f86052efb59980420ba8e120bfa7d4eb433a0","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.1.1","_nodeVersion":"15.14.0","_npmVersion":"lerna/4.0.0/node@v15.14.0+x64 (darwin)","dist":{"integrity":"sha512-eskXjJvQvZHMIn1vfKpARubXznSITngMDA/LpDQQHZdrFLJPBHRyQ/lBlSzhWUtwi24tPV92F7iSABV0aT+4Yg==","shasum":"419da4d6e9ac0794f6277ff4fa96fbd3eb611d80","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.1.1.tgz","fileCount":39,"unpackedSize":257053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3M6FCRA9TVsSAnZWagAAfWsP/RXk2LYtqypyXZmj6tI3\nHWvrPbF3Cr9TvPFtjUGmVF+cBospu3imzV3QLqPF+Aa/MF/N+TGikgTz53IL\n5X7mA/bFQyvTB3O2y3r6iWBqpZTkiCfQ6VGL+xhounOyRDMBJLY52lU3H2li\nTX3EFD8VIK0CTXP732LQ074DY09Nqj9ymn5B/0gen/DsWjFBJMMlNgY6+bjy\ntgQTeY7bUbUOXJyXh6Lcpb9y+LBpY1OcKGch4SEdFADgW8uK+HV9Idzj+OyN\noeqkV1Malknl+h4QyOupyb6KldkhCvX4HAuXV3HMjXIL1yUNmaApZynuJAFQ\nIGlECt+wAcR7s2McJ5DYAN2AiFhdQHgc6qGSrzagVDZ10Ux7TdSC+dIP7jrA\nQfu9Q3i5uksD87AbGVyMnb2gTVXoTOKEAExiKKKGZb3+r/Kts4+/N4f3lQnc\nTic5SmxQhfMlOOpqqNzifmRx08WqbiqdJ/7JDWItiS/oCa4kDmduv0Irtya4\nahE4KjYyWO8oQIhrv6vhfEL/oJ6M6lGInfHZIHM3GJlI7zYJ3tb2fNuEWa1G\n9mYaiRAf4elz8dUBn9GA6OhQ2RRXjnfI+RGpwgH3lQrdaqKbmaGX6+vlFo4+\nFEUqcXkCYtUvcwHigCc8wIu7DSAnsWBTLNdF8G9unUnTxWsKM566r3oUl7zS\nP1rl\r\n=Xt8H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1F0TaqqZizLdjec0d9NkCVXCTSWfVBNpFGBlGKKWZeQIhAKqgmbSXso88l8z3JwagQpfLDUWC7gqbxZGGC9qWC2vz"}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.1.1_1625083525268_0.3730559202296797"},"_hasShrinkwrap":false},"2.1.2":{"name":"@giraphql/plugin-errors","version":"2.1.2","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.9.1","@giraphql/plugin-validation":"^2.6.0","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"1b71ada86ca1fc5b2cedd4cc24a6433ca19ecc54","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.1.2","_nodeVersion":"15.14.0","_npmVersion":"lerna/4.0.0/node@v15.14.0+x64 (darwin)","dist":{"integrity":"sha512-NVICwDYySeTZOVy5PSV3C3ZpEWn26w0kdkolp+25lPJpQW9mlKXR46lD0ZxIkYKlG7g3JuR3i04eBruKJUowXg==","shasum":"1770d16f9d993962f74c56dc7f402e84ac131bdc","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.1.2.tgz","fileCount":39,"unpackedSize":258410,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg33JXCRA9TVsSAnZWagAAh2QQAJk/kp+vZZcjrtu9E5sm\niBACsqFyb6V3esRMFjP/m6Mix/UW7RQEWzm6Xa46rsYC/cCDBMiXhciDpRqj\n887LAnNCCkr9/G0PJDqxXByECsakfBFH/cbaX8l2RvRKFkpW3vQL2+yWaYvR\nbcceRgcpntEzEtgOFiRmVI9IKC18oh+Tt9avi6luOpYv/vmkNCW86bh2JcSp\nm8pUN7/dHj6RFrRn1o1yhi+Zwjf1L7weKGWvqtWnK+V7Htk80v60EENux4ee\nNa0fcaM6uJb2/MWjDnrFYpPWU2gyUFRSMMHmeQY8sN2MQdYpy2ppBv+IFoSJ\nONtxn8LtS4N5ZQolu2ICHk6R6RDNGbCTZjw7gbQ3RbVyzKcA76OlclJLy2le\nFsgT/lDtC202eOps0JAaqjHKWIMN4Nc7SwxuxLUVD6hK6Sb5fC7oMaSpJHgM\nS5+8Oiyo9WRsFs2bNWW0BcafXDYyTgIjDOHDJ48kv/XPP9ZYRBe7iwAl/IYU\nLcMzqvHT5nv8jOapJNSRSiCKpBEM9Ypafsq8IrPxyC26XOX6pio5oKNrdE0I\nyhB5NIkxW2k0sgrI+z/dSRg3wF6ESd+fxxz5L7BCmvNCvdgb0GWuIxtRb9QE\nfJCPU5R9Yeh79uU/XINWsYO1KrUcSgOJmn+U46ioNjCuUZCD+MnKsIgav1at\nBK4d\r\n=GWtl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrkHm7t2VHEKWSpovrLmdNOg5cM63zaT6pUqglfX94FwIgUH+3SO00jDPAWzzPWgjHihlsvtqezyHLro9NWvdvorA="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.1.2_1625256535215_0.6215178152600156"},"_hasShrinkwrap":false},"2.2.0-alpha.0":{"name":"@giraphql/plugin-errors","version":"2.2.0-alpha.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.10.0-alpha.0","@giraphql/plugin-validation":"^2.6.1-alpha.0","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"f04bb0d741042985bd6fb8a5659b7c72b297979c","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.2.0-alpha.0","_nodeVersion":"15.14.0","_npmVersion":"lerna/4.0.0/node@v15.14.0+x64 (darwin)","dist":{"integrity":"sha512-AlrrTetCwvDYmfpntJgbpdQZAztcdX9xZ362dvYXy+H+mCHxztnVaL2R+VqYMhhP1k8rDq7dCU4tVEZ1Cpq5jA==","shasum":"bbc9119d82d6360a34aec98352032fe306df2ef0","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.2.0-alpha.0.tgz","fileCount":39,"unpackedSize":101294,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4SvMCRA9TVsSAnZWagAACjwQAJkVegCqq6enqtrkm07q\nhwwLPiYurjGoGrZn58f4zyiULubeq33fi9LujJaj0498ydfTJQG6n3fTcXD1\nMnJxl+FzezXLEakZAMMJGbx0J49kRaiY1Fw9PTYj+u3RdL4EG5s2aj7omNWT\njBUyvhZLcvIlz5+GdsDtXaME+tj1Pt2Cm/Fy7G5Q1Zo2Vj1Dhi/Gd3BC3oDb\n9NwjuJc31lroTk9F5TGmESvt9BJuG8IOItS8Oxek+slPDtcUNv4jxgxtMT8n\nfzwLgtcTyVHImtBzTvpTZqqyW08Hlm996fVq0Si20DfIRxbplYoROejScWW0\nfUfzGRohLeJAzLm5szKEnNwTpPLGmSXpdSTa6w98jx2MblJ9bujeWUtV9yss\no/c7+NIoAnKVOiK2TijOt2UjrClW32X7C0aQWwooX8xaWnkcqaSjxlQTue+j\nMJRAiWKwx4LMhSnnMr3TnYl5tv/A115x1+XZDcyFghX++zXGqSTOE6JzUkB5\nK66akjjtFETDZNVYBf4BgZTpLwKciE912rHOYYfIsAGFkh28feQ9T9nd0oCq\nfYo8xBOHzLwL3T2bhaPwuiORkPMPBucksmHb80GeCkaKChmX83ZO1UzwZSv6\n+x4deGVKjuA9+m5lDOo6H8kV59Dok/N5Mk6K+IE2iZaDdYvdVMKPNl4w8Vyw\n9FSr\r\n=qEsy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDxpJWfWbtvCIjCqoG6cQEH8KwSiXZVi2qNL17xhCFJEAiAiyG9XQE197WGeK/6K9rwqbXDu6WU6xQNUkAb+cD/INA=="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.2.0-alpha.0_1625369548178_0.5337910271442177"},"_hasShrinkwrap":false},"2.2.0":{"name":"@giraphql/plugin-errors","version":"2.2.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.10.0","@giraphql/plugin-validation":"^2.6.1","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.2.0","_nodeVersion":"15.14.0","_npmVersion":"lerna/4.0.0/node@v15.14.0+x64 (darwin)","dist":{"integrity":"sha512-cf2mKSE9gNz3RYwb0AKtdmi33kQ71T3mU0W0cNDBQ8D3jWUNSkY9QGk3JD7c7kQjVNh3b64JyUYPRlYIOhFKcw==","shasum":"a8b15870239c64043262e6eed0fc02550a20f2c3","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.2.0.tgz","fileCount":39,"unpackedSize":101363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4TaPCRA9TVsSAnZWagAAb/QP/j3w8E2q3Rxf7y6is8X8\n43Y8obyk3XhJ/Ik8zh1NGETQYmKDu30kla11Bcolspm3E1ZVa/TiLJwNj6nN\n97OarKxf7NmmI+ywsdxsYEyommXddA5AKMbv1jt7mroXRxQJz87M52MjBIpm\nrI3F+HiMkzdk0tYJEOug2f4BN7JapOLUYkFzWM44No6aDGvzJtXOnbbAPvWt\nY3J5CXxD4Fyw8O2YNqvDmc+ZIcllKhSC6bL6lF0vZG299qjAwRBq/rXIdRe+\nbxOEJpSv8Rg5pStJOxmDu0OsRG6RUsuA6KLRnzbGJQwLT1aacL447YMtk98e\npcMO0g22H+N2L+CazX4oZI3y5v1ejWSFzGN4oqDT8VP5aT5zzvlYIMgZczep\n73j0iQGLJczYFTQWmMGUiJSqc74LSZx9WI877hDQkVTLxGZjMXD7sG+0pHpE\nbCpwAV4aUgBGfE2MfvDxujauH6O7rrZoKPbRRJcPpU35vAyvCLXKs/Ejq/uN\nnrSfCarT0WXFwIJREFO7PonMvAFKrzk3ScpQE8eN/68StXEP+gzsaWoNbQd6\n1E5SU9FeiCumTOE4L5vEjncQJjXTAIeZe7+tIkHZy+v5e0WxRyNdsIG5/rrS\n9HJmfgzitDivbV5GueMFzdwo7nYT9W3lbEBC/Iy+XbtNyLraiGqFD+sdRtKN\nk22R\r\n=F1Bf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEIhSGO7CUPNk4AFpumMhktKm2Ev6Mc9+XOtR2XDYsF/AiB9jdzfbrZ8c5tiL2EgKlACIBFTzHAXg4dKqnGbadBNGA=="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.2.0_1625372302813_0.15195339532157037"},"_hasShrinkwrap":false},"2.2.1":{"name":"@giraphql/plugin-errors","version":"2.2.1","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.10.1","@giraphql/plugin-validation":"^2.6.2","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"15509521ab5b20ba1a0cdaf5ae17e21c307f288a","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.2.1","_nodeVersion":"12.22.3","_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (darwin)","dist":{"integrity":"sha512-ch10y/z1rO6LutxoPi7P+qYUAdGlXfuJavrKeJDcI5Xbw3RPwSD/eDbBOCHR3N3Am19Pe3Sj6BHEyDK6EIXV1A==","shasum":"ee48652c70c8bd4819120434a835f6973a1d616d","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.2.1.tgz","fileCount":39,"unpackedSize":101456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6Rd1CRA9TVsSAnZWagAA0RwP/2QtNRZBv0vi8Q9jJGsd\nEznQA5g/MtbFfzpsgBCFEqq2zxylS5XD7TrgsqItOM9zP2BaQR9Nalnkz5tM\nAzqZhOWrTCmxanf/SC2SgyVTOwK/rhp+11qF5JdV/1FsSpJ1khluX+lLbxAx\n/Xzo/B06t6q8oD5p6ROxC2MOIGd2ova6zkTHyxmHglUzHWhWD8DhozrgB2O4\n8U+80UNatqgk06a0Q6Q6j/OMjnEbca7LxX/+kHrwgOB61QlMQkmhFW2ZMlBu\n9RxOAL2dkzir8gVSKAQybC5uYl7Cwm9Uf83Vqjf7tS1Ao9PUKOAnmOmGJD+N\n6H7oNTIlCUNGaDzSFptc/BzhJjhYuP5ftB5EsZe4rnxUlicyOUjWouKjgHEB\nP9M+RYYYrWMyE1ICmCjRdEkh0k+ldHkQmAzcUKZufoFxqcanSKUg+AWYlbH+\nGHCB7+CBQLlYABVr/e/BD0ClTFG6gqiKcT9yiUc6sMNE0olnCa7BKl8sLTer\n3p3+YkUgoivz9D1sE9ncJsTIJDSOIVns937gj4ZqxP8yeqNK6gz7hlx3NlLe\np95NNMrcp1HypmULwfAvzLppDlSG80eLaiEte5RQK5mSUINn45P/P/VkqFiE\n2TJF8XZSgZyLahqtKJD0HaUToiACdD4PmYexHtW7Ub8V8VAxAx+6/Om1ngN2\nBUrl\r\n=XJVK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVfgY2FCTFJp72SZvev7Dcr+oafBhXGnjiuGTyeHz8twIgRSe0t+gMEOraJUDi5gt/QTJiIm4lG4zGp9OEOXq9JsQ="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.2.1_1625888628638_0.9191308979585038"},"_hasShrinkwrap":false},"2.2.2-alpha.0":{"name":"@giraphql/plugin-errors","version":"2.2.2-alpha.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.10.2-alpha.0","@giraphql/plugin-validation":"^2.6.3-alpha.0","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"b42fce4efd2c4567c08615ab58f3dcd4a756f745","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.2.2-alpha.0","_nodeVersion":"14.17.3","_npmVersion":"lerna/4.0.0/node@v14.17.3+x64 (darwin)","dist":{"integrity":"sha512-lSKTqSZGbE9JitSzWgx1wcQrjVtA9RBWUe9xQJfuxSy9mL+BVE/XlGmEzkHC4pofv+fTEszl1aspH7dJYfNn6Q==","shasum":"2f226b9d3a69cf33b07840c0261aec8fca509ce1","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.2.2-alpha.0.tgz","fileCount":39,"unpackedSize":101581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8lOZCRA9TVsSAnZWagAAtb0P/iH0inmzwx7zpFBpBzF5\nGgatPvQEPy1ojKOSNjuxrj1FDHeUa6o+CiiMAz8in9eCzV5Fl6yUv1Z1fhfD\n8RxiR1PTMugtVtx3cgVKSe6WNS8KmtMNvjmThziR8JhPoIPgnc+r1kEtNukt\nzw1xhXwjle8FleWws4Uxb90xNlquCUGVRJbmILVlMkCUDzR2UHC8Z/ghMjXk\nn/jp2v418NTAOGSxi0F/NWQzQImvp5u4h9fRLoJUJxjyL1k35xvcOx/uOxvz\nVlPmoM8tDCw32qoPlLSr7KVvKok3RGZnEoh7JF7I4zMjz9YcoygLC2jhlJzX\nd84H9NorvMutfRU0wuk46Qli/ELhhp4T/a2z8vKax0IjQjHgjOsQO26WQv4a\ntspIOU/nkmMRj+Z6IYVYLmBKd7t+msn/OB6Ct4IiAiMqR4UfOrxYkHfRUjA9\nQR4K4bwpnjprFdzglzZ08qatMfpv5HdhRA8ptJucw0QHwjjuKRsmh/s/VSRQ\nLjgMN7ap1L+/UOS1rHrR6mpP9CXN8gW3TNcO1mtpGuiLuCs9p9rrcs5MENf5\nlX7i5zlUf5eb/Po6Q6RstbdfzoZhljrboAMek7aW3XUUWGpq8HaOtsnkbDlb\nW8q2q15TqAltzalXGCveEeQXQzJqPsfgmgohCAcnU2QNFVgS2wFmZQJtKDkc\ngceK\r\n=+IGJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvLDQMXzXP0YoKZpK57VZJk/RGqw4ralJqTQqwmZpL0QIgDMsAXtssJ/KQ+kZhXp/b9tH9R8jT/1clKpz1T5tJkgs="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.2.2-alpha.0_1626493849711_0.1041952793538703"},"_hasShrinkwrap":false},"2.2.2":{"name":"@giraphql/plugin-errors","version":"2.2.2","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.10.2","@giraphql/plugin-validation":"^2.6.3","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"fbab24dd5a3d379ac992bce22773f40196c1fdb5","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.2.2","_nodeVersion":"14.17.3","_npmVersion":"lerna/4.0.0/node@v14.17.3+x64 (darwin)","dist":{"integrity":"sha512-kaO3l6DMGXFk1sD1l2fxSbHyXdyyWfE9UK97LB9568XZyKVEOtPRrs9lffch5FadAsVU+Vd6cbKYF9gcsYRO4Q==","shasum":"2e9cd0e38e30466b81be29ba9920fdbdbfd3cdc4","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.2.2.tgz","fileCount":39,"unpackedSize":101650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+w10CRA9TVsSAnZWagAAts0QAJNr4JTE0FnwzBJFnBm1\n2Pn7CCS5CDySjTgfMQOL9yWbtLe9OAvTmt7zh7qra6tVScyg/jT6HwJF3SJa\nC1G3MbLfetyPES4kkP57O602BqVLYuebf3maWgBO1CJycj58qxxC4DgTaeeW\nFBmQ2IVerE2CGe8XgX5aNsG315ajapLAKqrh3FDC1Oe2tIK5pNsMCgWNG7ix\n37prCmt7UHffgRK29ptNhA4GkA/FK37xyfk3KqVep0Rwq/xMqWzTIR0vs12x\n9uvQzgawrQER8d6bfvZChaY7VcZo95CIkbGcXwznGK50VMgdwLSPg/XHWMew\n620pebp6i1b7qIIRJcJ4EfmXiWwCLHq60njzpVMq2e2Rclmuo3KLn179NO9b\nee1jg/wQ6k98QV9ICM1uyX4TDbCP+2HftDwvDo2dPknHdck5KiLXvmlffhPj\nlW2bzQGcmuYViU1a5WsYx09pi+3Mn4e6/S/FNBTmkRbzaciEDw09cW0yvXiR\nRzaKnYJtuq9BeUf1pnJrqeFaVmL1wXgf++doKghSnEWzr+pnPnU+SANFbj2+\nkGzbNrw/5PMgpU54Pgtx2LUjzAySFncNhz1qD/PjwwUGRuek1IXE+m0TOFiZ\nIn/iULkrJuESLu4GIcAVnkIpNN8LBc2Uu0V33XiLddSI3/ZXHzBTyDn2hUdw\n3PUr\r\n=1gEn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgB5dtz39ox8LyrUYTu7uD7/5O2dNK8A/xWOsu97O4FAIhAN1tWdJLGWhDxQJ+1QRH2q48NnRHXxV9IxUoWPWW1+Zc"}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.2.2_1627065716080_0.7818630991254805"},"_hasShrinkwrap":false},"2.3.0":{"name":"@giraphql/plugin-errors","version":"2.3.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.11.0","@giraphql/plugin-validation":"^2.7.0","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"220b996dbac73ebc4de820931bbe8dff60c7cad9","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.3.0","_nodeVersion":"14.17.3","_npmVersion":"lerna/4.0.0/node@v14.17.3+x64 (darwin)","dist":{"integrity":"sha512-vRF/YvsQCeCTD0lKTLL/sbsIQFcDunqIaXQ67Qs7iy33i6KiL3GEHF0snMqutCs47xSFG2UNQNMd+tHUeVJWOw==","shasum":"3d96668deeb5f9cd12162ee3315b1f1cfeb58916","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.3.0.tgz","fileCount":33,"unpackedSize":89691,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBIs3CRA9TVsSAnZWagAAHlEP/iO3HfTRhfbe5NcndsMa\n+1s0gxCL1e5/QpFyNGKoyINQupEduZOlBkbJiN61EI0vHzIHYj0gcLxstXZ7\n3w8bJrJNjaHcH9jYznL+SAyoGET1cregh36KZy6D1ibsM6stXPBjQJf0yGVw\n6P1JwTlynsHh8/czCpbYcYnuwE5ZIRqTt7+VQ0xmDn19FdV0ucOhQcSvbdfv\ndWI5X378WFM8/jKEl5zyd1C0D3dekJ7/UMrpqPFrnEJeTn4asCXtuH6j/vZz\nkBFBzxcgjDP3/RJHUstLX+Y85LFiztVm1SGo5NRqA7dhHFfXIUly+vvzFnhf\nSAbrMAMwB1ghvALCysm+XbbdajASvgyBwytwP46Vvmp8Cw/enlSzqUu/C7Bh\ntnfM4q66FxjBZyiAxkSKjAQLt0fbszZN+pJXG1IBMmf7Jzo97NFxSMofpBDE\nzBmEQoi3vNcCqsOUisjR6CK1a3rSbCrr8wOcpApViMxxcUjqoUIyszHxgcwo\n84Ma2TQlr/QgcCzhbMSYGQ9bvFfEZKaDAktaRTHEggBCqNOZr+N6JIcdtYv+\nzbFXZgvJjMwe9nJ19Wo2nCnoLBJpgEfAjRSElf+DFJ/pMKTvG0+gZOvLbbPq\nqBmgn0EmPIfFlFDAm3uMN8LF+nxJpdG2mCon+3Z+6icqtXDfKbyPqYU2/gX/\nSxLF\r\n=YjxA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8q89DdDrmeVilAMYyLOcdPEmnpxvQuh7MJ8oxOFJ7DAIgCzXvWfG+OtFvz1nilBgw32Up+RyUDw3TDW4Kvy2EhLo="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.3.0_1627687735267_0.8916271292509264"},"_hasShrinkwrap":false},"2.3.1-alpha.0":{"name":"@giraphql/plugin-errors","version":"2.3.1-alpha.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.12.0-alpha.0","@giraphql/plugin-validation":"^2.7.1-alpha.0","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9f586f4146acf7841706aba3ce84826d6e4f7cdf","readme":"# Errors Plugin\n\nA plugin for easily including error types in your GraphQL schema and hooking up error types to\nresolvers\n\n## Usage\n\n### Install\n\n```bash\nyarn add @giraphql/plugin-errors\n```\n\n### Setup\n\nEnsure that the target in your `tsconfig.json` is set to `es6` or higher (default is `es3`).\n\n### Example Ussage\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [],\n  },\n});\n\nbuilder.objectType(Error, {\n  name: 'Error',\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    hello: t.string({\n      errors: {\n        type: [Error],\n      },\n      args: {\n        name: t.arg.string({ required: false }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.slice(0, 1) !== name.slice(0, 1).toUpperCase()) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\nThe above example will produce a GraphQL schema that looks like:\n\n```graphql\ntype Error {\n  message: String!\n}\n\ntype Query {\n  hello(name: String!): QueryHelloResult\n}\n\nunion QueryExtendedErrorListOrError = Error | QueryHelloSuccess\n\ntype QueryHelloSuccess {\n  data: String!\n}\n```\n\nThis field can be queried using fragments like:\n\n```graphql\nquery {\n  hello(name: \"World\") {\n    __typename\n    ... on Error {\n      message\n    }\n    ... on QueryHelloSuccess {\n      data\n    }\n  }\n}\n```\n\nThis plugin works by wrapping fields that define error options in a union type. This union consists\nof an object type for each error type defined for the field, and a Success object type that wraps\nthe returned data. If the fields resolver throws an instance of one of the defined errors, the\nerrors plugin will automatically resolve to the corresponding error object type.\n\n### Builder options\n\n- `defaultTypes`: An array of Error classes to include in every field with error handling.\n\n### Options on Fields\n\n- `types`: An array of Error classes to catch and handle as error objects in the schema. Will be\n  merged with `defaultTypes` from builder.\n- `union`: An options object for the union type. Can include any normal union type options, and\n  `name` option for setting a custom name for the union type.\n- `result`: An options object for result object type. Can include any normal object type options,\n  and `name` option for setting a custom name for the result type.\n- `dataField`: An options object for the data field on the result object. This field will be named\n  `data` by default, but can be written by passsing a custom `name` option.\n\n### Recommended Ussage\n\n1. Set up an Error interface\n2. Create a BaseError object type\n3. Include the Error interface in any custom Error types you define\n4. Include the BaseError type in the `defaultTypes` in the builder config\n\nThis pattern will allow you to consistently query your schema using a `... on Error { message }`\nfragment since all Error classes extend that interface. If your client want's to query details of\nmore specialized error types, they can just add a fragment for the errors it cares about. This\npattern should also make it easier to make future changes without unexpected breaking changes for\nyour clients.\n\nThe follow is a small example of this pattern:\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [Error],\n  },\n});\n\nconst ErrorInterface = builder.interfaceRef<Error>('Error').implement({\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.objectType(Error, {\n  name: 'BaseError',\n  isTypeOf: (obj) => obj instanceof Error,\n  interfaces: [ErrorInterface],\n});\n\nclass LengthError extends Error {\n  minLength: number;\n\n  constructor(minLength: number) {\n    super(`string length should be at least ${minLength}`);\n\n    this.minLength = minLength;\n    this.name = 'LengthError';\n  }\n}\n\nbuilder.objectType(LengthError, {\n  name: 'LengthError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof LengthError,\n  fields: (t) => ({\n    minLength: t.exposeInt('minLength'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    // Simple error handling just using base error class\n    hello: t.string({\n      errors: {},\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (!name.startsWith(name.slice(0, 1).toUpperCase())) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n    // Handling custom errors\n    helloWithMinLength: t.string({\n      errors: {\n        types: [LengthError],\n      },\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.length < 5) {\n          throw new LengthError(5);\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\n### With validation plugin\n\nTo use this in combination with the validation plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nOnce your plugins are set up, you can define types for a ZodError, the same way you would for any\nother error type. Below is a simple example of how this can be done, but the specifics of how you\nstructure your error types are left up to you.\n\n```typescript\n// Util for flattening zod errors into something easier to represent in your Schema.\nfunction flattenErrors(\n  error: ZodFormattedError<unknown>,\n  path: string[],\n): { path: string[]; message: string }[] {\n  // eslint-disable-next-line no-underscore-dangle\n  const errors = error._errors.map((message) => ({\n    path,\n    message,\n  }));\n\n  Object.keys(error).forEach((key) => {\n    if (key !== '_errors') {\n      errors.push(\n        ...flattenErrors((error as Record<string, unknown>)[key] as ZodFormattedError<unknown>, [\n          ...path,\n          key,\n        ]),\n      );\n    }\n  });\n\n  return errors;\n}\n\n// A type for the individual validation issues\nconst ZodFieldError = builder\n  .objectRef<{\n    message: string;\n    path: string[];\n  }>('ZodFieldError')\n  .implement({\n    fields: (t) => ({\n      message: t.exposeString('message'),\n      path: t.exposeStringList('path'),\n    }),\n  });\n\n// The actual error type\nbuilder.objectType(ZodError, {\n  name: 'ZodError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof ZodError,\n  fields: (t) => ({\n    fieldErrors: t.field({\n      type: [ZodFieldError],\n      resolve: (err) => flattenErrors(err.format(), []),\n    }),\n  }),\n});\n\nbuilder.queryField('fieldWIthValidation', (t) =>\n  t.boolean({\n    errors: {\n      types: [ZodError],\n    },\n    args: {\n      string: t.arg.string({\n        validate: {\n          type: 'string',\n          minLength: 3,\n        },\n      }),\n    },\n    resolve: () => true,\n  }),\n);\n```\n\nExample query:\n\n```graphql\nquery {\n  validation(string: \"a\") {\n    __typename\n    ... on QueryValidationSuccess {\n      data\n    }\n    ... on ZodError {\n      fieldErrors {\n        message\n        path\n      }\n    }\n  }\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.3.1-alpha.0","_nodeVersion":"14.17.3","_npmVersion":"lerna/4.0.0/node@v14.17.3+x64 (darwin)","dist":{"integrity":"sha512-3PIzG6YKEAsnnGGlARn0RyYno2Nh4L/iVCXocIAhoco8yZ1YT/l2CPzhQWY5yg8N7Wrt9LiLh1hIDLLK6NVcSw==","shasum":"a2230330e07ee2530ab7b186f71332e10231de8d","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.3.1-alpha.0.tgz","fileCount":33,"unpackedSize":89820,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhB313CRA9TVsSAnZWagAAwtUQAJgItWLz5x8Ufnn9f5Qi\niHz5xdKwZKBzaPgw/T2hUfEWXVBR9ohX44qRPm/lYenPmWDJEXl2n1z9WIao\nICBpbAvNsa1kVB3JbkwOggpzVaouRZUyPsyB5iOhA0Ch/lqVoZw76mEgXvQ5\nL2qpkM1Rn882XwiFwxYXpiDAIJZ5RzhKNjTEPAAQRPcPMdMz9vCABxnbD76K\njfHUntvfUBJadJj77R/36gz4c3IPdgoJ2Ne1PC0fibD1MRVouT9NhZqGv5dK\nB8ZU+e/tFf6A04dUSd4McRcl19VI7wjYIQb5Nai+uNRR/RG1DB02C4fB6rbD\nNOs+Dssz+uGX6L5C/cKrAOo4ojoDow8MysUDH7BZGG9gXm0lxhwFnWpSq8k7\nl+vojn65omNXhxoPIB+IewLSHHItDFSA2f18e5CrKGf6LXVOlx0xA1l4h+4Y\nL08TPbGwu2+X9FU8YLIXb0ZWDtpJrHbhm65ZuQQKRe0vgBuyqzeM3s9vdEXE\n2JnlE76C9IayKjj3htVmDynJir+WWKit7updxFpyNaYZzyO3yNrSjbm1tEeQ\nOvzfI317rHv5w2K2NVkwHCBXaPaI1spGrHPKZmfOMRbEjB+kF9BXDTgMrzfQ\nO/ep5az1rIz4SyLYTjikQw66hFTQj7kas0aDpDEfPd7IB/UU0kGphKxwl26D\no8Dr\r\n=1Bio\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHn1eH5K3ZsIoYsD5Hl6pqD4VydJZeFQ29V6fiGmOqzuAiEAy7lBY4rZbbf17DTFhzYB8xZVYCsQgj1U8OqE0YNYhaU="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.3.1-alpha.0_1627880823777_0.2402009415265467"},"_hasShrinkwrap":false},"2.3.1":{"name":"@giraphql/plugin-errors","version":"2.3.1","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.12.0","@giraphql/plugin-validation":"^2.7.1","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"c28e5daa0ddb0e240b97113013790586e858f49f","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.3.1","_nodeVersion":"14.17.3","_npmVersion":"lerna/4.0.0/node@v14.17.3+x64 (darwin)","dist":{"integrity":"sha512-Vdt/TUAGfNg1sntvnDCuWAT5Bk8yAdzKnB3lvrIZ3dqfoaCh/SQbJH5DbD2bSZA4fm7SRpLLsA8TBmqi+JrgpQ==","shasum":"c919ae6096e4f32e61880b40eeaa283ffbc33459","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.3.1.tgz","fileCount":33,"unpackedSize":90043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCMA1CRA9TVsSAnZWagAAl/sP/RHSjjtuZfYciXEcdNFc\nAvi+cJBuSXZTrVCT2PaCyh8sLcqpOdz08NI2/lyDpOj17eEpfSnfYu5QVgrm\nN2nt2OSoPOmnDjpf/7Cj0G/3n3WuSQmUFqZI4IyKU+FlbLXHm8QGut8MS8kl\n640FkON+/73Y9oRDmp6HA/2xmeJ3syJdOiOTrfE8BPh31VtNG92r/wgshz5q\njsIcBij3+bNpCHk4EvvW5jj/LXvOOPYuIyO51gSrXLRDHfMC7zuB1U6ZZL4d\neINd2Kvb4zo6EzkfcQGpzjY3WcNnsEcPiqQjVTIol+xcI8yfZ1+cGRYJDYgS\nSOyxIDMcRF9KX/lttE7kGuhhAtAmuA2DTElcU8/4SGS3ZgtnmEfXZmXiNKBd\n0BNxniwirNeA0quMsbbPpOZtz0fHBxJqiYlnKXKdzCvKTuMDvV+qAQJGcHMh\nE0TsfRJK9nRA79qpx5XQ0mquCttANoYUZGQYQpPpa4bzn2+2T/2zO+M+FyHO\nckN1c8sr24y+Qwa+T9ZoUP82C6SQfQkuwT6h5sfgrHTHCosIsE7zqCP+OTSp\n1CXXSgwvTra46KlDkQ2ygJm8+95J1OlGJ1aPywbFFkx/5KTQixiz7yY69sR5\nkD+U3uyrWAiYzU7TdSWp9Ws7pUX5UaixRD+bzENQDa242QpUO64ijw05n9/A\nWm3m\r\n=D05e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFNPgRggBN2RiZOccAKShepdgWOzv23jlw7e+FFQ1L+0AiAwIQMtQ8odLPGF29KwF8pBSIZGZ8i9yIxFRaPcUUbYkw=="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.3.1_1627963445220_0.3925183347547361"},"_hasShrinkwrap":false},"2.4.0":{"name":"@giraphql/plugin-errors","version":"2.4.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.13.0","@giraphql/plugin-validation":"^2.8.0","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.4.0.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.4.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-6FL4aVYSRGzNyWe0oB524/n7uCYlv87SU6pfGE0zL9/nLbK0B7G5suJsZ2uJTrYrcUia+siFuUN8Occa7EjDeQ==","shasum":"6ad64e3078abae6744ac56fe77392a279de84081","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.4.0.tgz","fileCount":8,"unpackedSize":17976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhC5AjCRA9TVsSAnZWagAAgJgQAIB5KaHTUewzja0OYqyk\nffqLwAoFTLJpOSDhIyes/sNvgpsQf1sO38bFZOCHinw3fNdL2RIPVg/Aw1aL\nToQrUOQdjEvjusY1UTJ/vBD+0oCB9orn4hC7RZO9URyCi09O9Jy39YmmGHNH\nPvHx/4MJ93AFcoIjfDYIG/5hM3Q9lfX/EwenR5pYgaAT6TGfpgUtcGSwPfmq\n5ZnoEnTLuRBa/rUe5GHOtGNvaNvfQXKb4Ia85366ovNzUx8CjkJTIT5wGBJI\nIXMHDXLmeeUF84rtfDZbUHRMqplMwon/1CTa4/fON+G20aqjCxGepSZpoQKu\nLkQEKGOWfOf7pTlsljFwRxPXoK1koslQY2dOPF3UGPv2/F4MpkxJipYFXQkV\ngK6rrjipeuK86blWwYZlcZUxiLPc5pGDqjMlSZ8l3hsvLFTFTtl907ENJPqq\njdbi8hD4s7kablelZmCBTvAiJ6TawvMorr1WMtVzYZBqvtaQ6qCQ1TtH2Pgy\nRrxMLP0nbHy+hvnBs6L/MwCn++GGKVInNp8JHw9FdiVqc0GNQk31lFWcHMzZ\n9N8wSnVHmK1hGWrhX5SwMPcy8Df4pldAds8pgXCmxnUAXyKWo/vp7OIGUVSa\nmdNTrJsEvSdGBDkE7kiiEVwuUsuq2dxsOlXniLDXjXOJT/itGXM0FCYRGeB+\nxwcs\r\n=rKyl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEqqrtCHqSX2H6Vgj/ScTaRkSmXrq/vvnYSYS6SWzbqFAiEAj9ahtpkXzYnnfgyanAl0dQ7/ok9lErGhPrEXjKdskK8="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.4.0_1628147747217_0.3482224556662301"},"_hasShrinkwrap":false},"2.4.1":{"name":"@giraphql/plugin-errors","version":"2.4.1","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.13.1","@giraphql/plugin-validation":"^2.8.1","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.4.1.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.4.1","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-zsYyR/LrQfV/CWl4usl4B3waMnKLF0YtXhLwZn169U5ZuwvLBa8q3IEAXCeOSbbhuV4gC9bqMHBJYYqFNXP2zQ==","shasum":"0e4aa3d5121ba99713e5b49dda1cde22987d7a3b","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.4.1.tgz","fileCount":33,"unpackedSize":101695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhC5HFCRA9TVsSAnZWagAAnCwP/Rh9o8lhkoyeagcRkIEq\nGoAddeAJbUoe06IEewNWH1f6TfedSyjCWh2C/gj//ZYPaV0/oTo5IE1Pyntp\neAm6UvnRRkYyqEA21hk/3+FujHuXmrQri9nfXBA5OzSk23EAuIPjxP7N6yQ6\nutdqtW2X3qemB5xxwpzF5j71AQzhKTBdOAst2hbjWBpue/UiCmu5ydq+Lqrl\ny+Dy6cfDSapCA3W4CMJWGhXqL49SVJ43iX3SKMvgdmYtE+6/Dz0ByiqLndA5\ncl4of5Z5htMKYJ9fruOiac8kpkGCTtCnnC7HQ69QRC5yRPjpo10HW77Vo2NE\nwI5AYjxBtKvptJvdR00PelGz0ZnvIfS1qMJ7uZGBUyBcmGWrhL1ve1eKxz8m\n2uRUiT/2G+gs55Z5lr69jsvZM85kC+AmA4fkIzLuyoqFWRI5t/5W7GvE3GXC\nNqcrUwwSr36pOOD/lXTtwm+y9DwWV1H6GEC4kwxxA0Z4xkSLnAe5Ag0IN6JS\nZNIiThA1n6Dfp1h7E1rrICeYKprn1ZLsakFCHUjX4ptrrtGRo1skmuZmGYOk\ngxs16YxbiMO8mWhnca3mshbqVMa0tFNXcRv4utZ2dJhpG95yr+mI4CtflV4I\no1sBQ5q0oDxHwd/DFx3nJd0TODQpXEBhpHCxhRgjDhfgvs4mf411JGe/rV/+\nnnVZ\r\n=8uI8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUROiCSgkcKRQweC/lFi2GxzTywBYg2c46w8ZqigD5lgIgWsHBn6/x4OxYI1jmHJ/bELEPN7p4DIK1fhzGBrkWGjA="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.4.1_1628148165464_0.8296577315747233"},"_hasShrinkwrap":false},"0.0.0-preview-202177065":{"name":"@giraphql/plugin-errors","version":"0.0.0-preview-202177065","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^0.0.0-preview-202177065","@giraphql/plugin-validation":"^0.0.0-preview-202177065","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-0.0.0-preview-202177065.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@0.0.0-preview-202177065","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-6vcaLpg1yyxKlGusPyJqFWyJcuAJIj10C5CVWK35tgd33kGJDg/4K7hf+JCfpiBh4NMimgTJgcGFZr8q/X97VQ==","shasum":"ba6284e08693fe9a84d9114ad91248c23161036b","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-0.0.0-preview-202177065.tgz","fileCount":33,"unpackedSize":102070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDc6mCRA9TVsSAnZWagAA4ZUP/0UDHkbdKzvRp2wUw9eA\nj4Og+3i+9bdhHCJwPealDRJuHN32DmSw8/ioyZzvClCm6kA9/B6zWLAB2nZm\nhH6phl4hXQfC9rX+QJKwJl5pbUymbDWlPOloGGMM0rAMIL8v3W6MmV38a9WX\nt7AlueWDpFaIS6F0eGnS5tauutTtBsUF/9ocE0ZcmvFBVOE/Kv3Ix2odC1wp\nD++zfoEYOBEz66LkqGa6m4LaTRl4CE1wucbwWK7r9re1Zt1TqcZxoxzvrPcR\nrdoPdzyF1jSykA21Kx8kP66Cq5j1mRHm+J61QdmdJVk0wN6gw3df/u8dKSvu\nMMdRsal2BDEbelKmfKL1p23Q0r5tWZTcLZlJfQrlP4RgXkfDiYI53GJLfizB\nylE31v3muTWgdtAPvrRpDsxV8j+2sAe5MJYii+BJ2HNpif00lvGpmySRW8ZL\nU1jFI7hV4sz18fsiOLTf9ZAod5gPfbaOvBErmYPBYEDJfbLscb5P921pzvvY\n4Is6ip5GOC72oYb1A/Bq/uZYPmPGnjqoktvKk1DPVpEKSYAxIJ+Ke0SUjv0/\nuv9eg44uI790//jRqm+yWn2zhxMF4bxjd7yfPeFYSxyzJOrQ9DIkc9mD/Px7\nNxxvTya3yO0jbfPrcglsWpZKF6O0XSxYzBX9b4CwASw2iYpUCN0/Ez7akIUE\nUxcA\r\n=SzOm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHtF4kdAMRr6hCJhw11O+/VVBVVD3vHnhD6PlpHleVfIAiEAwAks/X+s00Gkx5eOZQ0YBgtVX//EIb4RshV5k0Sx1aY="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_0.0.0-preview-202177065_1628294822178_0.9768538829603604"},"_hasShrinkwrap":false},"0.0.0-preview-20217701452":{"name":"@giraphql/plugin-errors","version":"0.0.0-preview-20217701452","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^0.0.0-preview-20217701452","@giraphql/plugin-validation":"^0.0.0-preview-20217701452","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-0.0.0-preview-20217701452.tgz","readme":"# Errors Plugin\n\nA plugin for easily including error types in your GraphQL schema and hooking up error types to\nresolvers\n\n## Usage\n\n### Install\n\n```bash\nyarn add @giraphql/plugin-errors\n```\n\n### Setup\n\nEnsure that the target in your `tsconfig.json` is set to `es6` or higher (default is `es3`).\n\n### Example Ussage\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [],\n  },\n});\n\nbuilder.objectType(Error, {\n  name: 'Error',\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    hello: t.string({\n      errors: {\n        type: [Error],\n      },\n      args: {\n        name: t.arg.string({ required: false }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.slice(0, 1) !== name.slice(0, 1).toUpperCase()) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\nThe above example will produce a GraphQL schema that looks like:\n\n```graphql\ntype Error {\n  message: String!\n}\n\ntype Query {\n  hello(name: String!): QueryHelloResult\n}\n\nunion QueryExtendedErrorListOrError = Error | QueryHelloSuccess\n\ntype QueryHelloSuccess {\n  data: String!\n}\n```\n\nThis field can be queried using fragments like:\n\n```graphql\nquery {\n  hello(name: \"World\") {\n    __typename\n    ... on Error {\n      message\n    }\n    ... on QueryHelloSuccess {\n      data\n    }\n  }\n}\n```\n\nThis plugin works by wrapping fields that define error options in a union type. This union consists\nof an object type for each error type defined for the field, and a Success object type that wraps\nthe returned data. If the fields resolver throws an instance of one of the defined errors, the\nerrors plugin will automatically resolve to the corresponding error object type.\n\n### Builder options\n\n- `defaultTypes`: An array of Error classes to include in every field with error handling.\n\n### Options on Fields\n\n- `types`: An array of Error classes to catch and handle as error objects in the schema. Will be\n  merged with `defaultTypes` from builder.\n- `union`: An options object for the union type. Can include any normal union type options, and\n  `name` option for setting a custom name for the union type.\n- `result`: An options object for result object type. Can include any normal object type options,\n  and `name` option for setting a custom name for the result type.\n- `dataField`: An options object for the data field on the result object. This field will be named\n  `data` by default, but can be written by passsing a custom `name` option.\n\n### Recommended Ussage\n\n1. Set up an Error interface\n2. Create a BaseError object type\n3. Include the Error interface in any custom Error types you define\n4. Include the BaseError type in the `defaultTypes` in the builder config\n\nThis pattern will allow you to consistently query your schema using a `... on Error { message }`\nfragment since all Error classes extend that interface. If your client want's to query details of\nmore specialized error types, they can just add a fragment for the errors it cares about. This\npattern should also make it easier to make future changes without unexpected breaking changes for\nyour clients.\n\nThe follow is a small example of this pattern:\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [Error],\n  },\n});\n\nconst ErrorInterface = builder.interfaceRef<Error>('Error').implement({\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.objectType(Error, {\n  name: 'BaseError',\n  isTypeOf: (obj) => obj instanceof Error,\n  interfaces: [ErrorInterface],\n});\n\nclass LengthError extends Error {\n  minLength: number;\n\n  constructor(minLength: number) {\n    super(`string length should be at least ${minLength}`);\n\n    this.minLength = minLength;\n    this.name = 'LengthError';\n  }\n}\n\nbuilder.objectType(LengthError, {\n  name: 'LengthError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof LengthError,\n  fields: (t) => ({\n    minLength: t.exposeInt('minLength'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    // Simple error handling just using base error class\n    hello: t.string({\n      errors: {},\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (!name.startsWith(name.slice(0, 1).toUpperCase())) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n    // Handling custom errors\n    helloWithMinLength: t.string({\n      errors: {\n        types: [LengthError],\n      },\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.length < 5) {\n          throw new LengthError(5);\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\n### With validation plugin\n\nTo use this in combination with the validation plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nOnce your plugins are set up, you can define types for a ZodError, the same way you would for any\nother error type. Below is a simple example of how this can be done, but the specifics of how you\nstructure your error types are left up to you.\n\n```typescript\n// Util for flattening zod errors into something easier to represent in your Schema.\nfunction flattenErrors(\n  error: ZodFormattedError<unknown>,\n  path: string[],\n): { path: string[]; message: string }[] {\n  // eslint-disable-next-line no-underscore-dangle\n  const errors = error._errors.map((message) => ({\n    path,\n    message,\n  }));\n\n  Object.keys(error).forEach((key) => {\n    if (key !== '_errors') {\n      errors.push(\n        ...flattenErrors((error as Record<string, unknown>)[key] as ZodFormattedError<unknown>, [\n          ...path,\n          key,\n        ]),\n      );\n    }\n  });\n\n  return errors;\n}\n\n// A type for the individual validation issues\nconst ZodFieldError = builder\n  .objectRef<{\n    message: string;\n    path: string[];\n  }>('ZodFieldError')\n  .implement({\n    fields: (t) => ({\n      message: t.exposeString('message'),\n      path: t.exposeStringList('path'),\n    }),\n  });\n\n// The actual error type\nbuilder.objectType(ZodError, {\n  name: 'ZodError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof ZodError,\n  fields: (t) => ({\n    fieldErrors: t.field({\n      type: [ZodFieldError],\n      resolve: (err) => flattenErrors(err.format(), []),\n    }),\n  }),\n});\n\nbuilder.queryField('fieldWIthValidation', (t) =>\n  t.boolean({\n    errors: {\n      types: [ZodError],\n    },\n    args: {\n      string: t.arg.string({\n        validate: {\n          type: 'string',\n          minLength: 3,\n        },\n      }),\n    },\n    resolve: () => true,\n  }),\n);\n```\n\nExample query:\n\n```graphql\nquery {\n  validation(string: \"a\") {\n    __typename\n    ... on QueryValidationSuccess {\n      data\n    }\n    ... on ZodError {\n      fieldErrors {\n        message\n        path\n      }\n    }\n  }\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@0.0.0-preview-20217701452","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-63i8hzB+k74M/SxrCxZRX878+PWZdPWyGMGNlDyXaSQUJFUuM/0KrxsTYdkdQ0/51B3b1Jk4pzikrnz0cAkDcQ==","shasum":"0841a9dcafc25f96ead63b7e52b28b5b5ef808ca","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-0.0.0-preview-20217701452.tgz","fileCount":33,"unpackedSize":102078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDdCKCRA9TVsSAnZWagAAolwP/154CB9fl1I7kn66OEcZ\nGQRRnkUtjLVXCPzR9KS+b63HO3hxc3/W6Ej4HsN87V9A324xS46mOrVbuyY4\ncOHG8bcRF4hm93aSZWG0sYBu0xkvq1GfCYCR1+E2Fb7yzQbyPpFb45rHO8sK\nu8wkJ7vvTRbk47efWe9FN4elrInxjqZz5bXVZGlvvBzsSrL0mJ897bAZk91w\nd1x1Bsqb9EKKj/uUlD7Om67Tc7QsmGvR44jvFymHlf3rgTSeO3t4KlZLmwTA\nofHXjYl07otc4aMZZCjf+/XiB37Bkml40O1AnrMOyJcOZ0uP0W3yfyCKdVe0\n26lM0qiiTukIa6rbo3s4qyHhzocMNc+ZQXqsmrdk7JYnUnEa/rJrmAxwbEzI\nIFm7HC/ptkXecrxGFs3cxl6yyCZJ15/BAd+O4EVoVr6qUrxGRkYwkvSg1irf\nlWDQVfrEriSI9J8Fu3/F8qdJW/t27rrEB/+sVWqaTbRceWuPkEhMDOW5YjN4\ng/K0G62uRcEZxcKmCLbDlrmPXiy877zE3fjTNsKirt7TDllBJLPdpyFEW5Dx\nUpz45EDm+ocqWfxa3GvsrnQSF3hDpw/R+AYhbfQ41TpTbzCKsicEslTpy6RH\nGlZVTNipcl5z9TseuOZVPo43r2ms0WJ6tabEZyk0fM1MZWGmfQAf0vxhnDta\nd15p\r\n=oXYt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrYA8+0wHdYRbMepkqfx8qHLinS0oawEm8fgP/QySZqAIgaflV+ITrkOG01NHZPRGaHlouHlzc9r5Mi0ajP6flB5w="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_0.0.0-preview-20217701452_1628295306169_0.6764865478213704"},"_hasShrinkwrap":false},"2.4.2":{"name":"@giraphql/plugin-errors","version":"2.4.2","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.13.2","@giraphql/plugin-validation":"^2.8.2","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.4.2.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.4.2","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-K6pTneg7hS84OP2DD9zoBG5VREozHNGrVXD2Zuqv1PO3xbwgnsSfyfduPyBtbcMJfrP2EwbdiNYgSsescNeDxw==","shasum":"cd63c6b54fb0f65b10d84415cb727e03f22720b1","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.4.2.tgz","fileCount":33,"unpackedSize":101759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDdCiCRA9TVsSAnZWagAAmTAQAJ0JUkLucXAM62vgprxE\nTrlO2MrHz7kLlfoq/T1IlwP+IZ+Aff1rFK5BKZrjLUzPUjaJw5JCOEt3G8x7\nLp3KmkbULJW/c0SdVQsHVRdwyrv/M03VqpflrFFLQ334r27zusXBdTtqIMwt\n09+zTJwFctPIHbJHu9Z0zTF7orE/dprk4DmhdohXU62X7lyJfjG8BTdnKl+n\n2oNNh0ijnbtuc7Dne6HCijpHJeu4sXCrU76yyQPcX226NwdJ90f5QYsQZS10\n9yADWIgjZ3R6kSakYOlmtJrHzP6rTpNCZHRfcr1FFeQ6C4q1MkUhwxihzXY0\nwiNBK4kw6yUf74x3KBLdLq231CmPUXx5zPs1IZFZou/UlXh9/zXj3+klcWbT\nhe7dA3Wr221ohzuVtq8p/2MwHCUWdK0hRXQm7XEdYdvx2GV0dVEYvIVOpaA5\nTRb9JuenC2x7C4vDrm6jtv1vrxTKCowFlHHFVEJitXDggCaUGhrDYiRwzdsz\ntTa/L8xGIqVi5cXCxJGamkAMkstT0dCkWwhObPNZIDPvTHCx1mPRVMf5xV6M\nYF0Q/XTf0rh4FxfGo7RWFAYZHst23pe75XNubLgfTRokGNlihk8k7+xWP9GJ\nrCNj2OF3dsFPB1v/Y1xemEROpzPp1B61j1RsCr22ZJoxI955bTAqCHcmEDyZ\n0645\r\n=NDVV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCs0bI3PYO05AKl57EdHd3hRKtvdkhmVlQNkz6EzCNHcAIgFulBVnExeLT2fdShmuolBFcNrYYDCQz5hYzJEABjfOQ="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.4.2_1628295330000_0.4681749720162265"},"_hasShrinkwrap":false},"0.0.0-preview-20217752147":{"name":"@giraphql/plugin-errors","version":"0.0.0-preview-20217752147","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^0.0.0-preview-20217752147","@giraphql/plugin-validation":"^0.0.0-preview-20217752147","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-0.0.0-preview-20217752147.tgz","readme":"# Errors Plugin\n\nA plugin for easily including error types in your GraphQL schema and hooking up error types to\nresolvers\n\n## Usage\n\n### Install\n\n```bash\nyarn add @giraphql/plugin-errors\n```\n\n### Setup\n\nEnsure that the target in your `tsconfig.json` is set to `es6` or higher (default is `es3`).\n\n### Example Ussage\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [],\n  },\n});\n\nbuilder.objectType(Error, {\n  name: 'Error',\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    hello: t.string({\n      errors: {\n        type: [Error],\n      },\n      args: {\n        name: t.arg.string({ required: false }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.slice(0, 1) !== name.slice(0, 1).toUpperCase()) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\nThe above example will produce a GraphQL schema that looks like:\n\n```graphql\ntype Error {\n  message: String!\n}\n\ntype Query {\n  hello(name: String!): QueryHelloResult\n}\n\nunion QueryExtendedErrorListOrError = Error | QueryHelloSuccess\n\ntype QueryHelloSuccess {\n  data: String!\n}\n```\n\nThis field can be queried using fragments like:\n\n```graphql\nquery {\n  hello(name: \"World\") {\n    __typename\n    ... on Error {\n      message\n    }\n    ... on QueryHelloSuccess {\n      data\n    }\n  }\n}\n```\n\nThis plugin works by wrapping fields that define error options in a union type. This union consists\nof an object type for each error type defined for the field, and a Success object type that wraps\nthe returned data. If the fields resolver throws an instance of one of the defined errors, the\nerrors plugin will automatically resolve to the corresponding error object type.\n\n### Builder options\n\n- `defaultTypes`: An array of Error classes to include in every field with error handling.\n\n### Options on Fields\n\n- `types`: An array of Error classes to catch and handle as error objects in the schema. Will be\n  merged with `defaultTypes` from builder.\n- `union`: An options object for the union type. Can include any normal union type options, and\n  `name` option for setting a custom name for the union type.\n- `result`: An options object for result object type. Can include any normal object type options,\n  and `name` option for setting a custom name for the result type.\n- `dataField`: An options object for the data field on the result object. This field will be named\n  `data` by default, but can be written by passsing a custom `name` option.\n\n### Recommended Ussage\n\n1. Set up an Error interface\n2. Create a BaseError object type\n3. Include the Error interface in any custom Error types you define\n4. Include the BaseError type in the `defaultTypes` in the builder config\n\nThis pattern will allow you to consistently query your schema using a `... on Error { message }`\nfragment since all Error classes extend that interface. If your client want's to query details of\nmore specialized error types, they can just add a fragment for the errors it cares about. This\npattern should also make it easier to make future changes without unexpected breaking changes for\nyour clients.\n\nThe follow is a small example of this pattern:\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [Error],\n  },\n});\n\nconst ErrorInterface = builder.interfaceRef<Error>('Error').implement({\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.objectType(Error, {\n  name: 'BaseError',\n  isTypeOf: (obj) => obj instanceof Error,\n  interfaces: [ErrorInterface],\n});\n\nclass LengthError extends Error {\n  minLength: number;\n\n  constructor(minLength: number) {\n    super(`string length should be at least ${minLength}`);\n\n    this.minLength = minLength;\n    this.name = 'LengthError';\n  }\n}\n\nbuilder.objectType(LengthError, {\n  name: 'LengthError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof LengthError,\n  fields: (t) => ({\n    minLength: t.exposeInt('minLength'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    // Simple error handling just using base error class\n    hello: t.string({\n      errors: {},\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (!name.startsWith(name.slice(0, 1).toUpperCase())) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n    // Handling custom errors\n    helloWithMinLength: t.string({\n      errors: {\n        types: [LengthError],\n      },\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.length < 5) {\n          throw new LengthError(5);\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\n### With validation plugin\n\nTo use this in combination with the validation plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nOnce your plugins are set up, you can define types for a ZodError, the same way you would for any\nother error type. Below is a simple example of how this can be done, but the specifics of how you\nstructure your error types are left up to you.\n\n```typescript\n// Util for flattening zod errors into something easier to represent in your Schema.\nfunction flattenErrors(\n  error: ZodFormattedError<unknown>,\n  path: string[],\n): { path: string[]; message: string }[] {\n  // eslint-disable-next-line no-underscore-dangle\n  const errors = error._errors.map((message) => ({\n    path,\n    message,\n  }));\n\n  Object.keys(error).forEach((key) => {\n    if (key !== '_errors') {\n      errors.push(\n        ...flattenErrors((error as Record<string, unknown>)[key] as ZodFormattedError<unknown>, [\n          ...path,\n          key,\n        ]),\n      );\n    }\n  });\n\n  return errors;\n}\n\n// A type for the individual validation issues\nconst ZodFieldError = builder\n  .objectRef<{\n    message: string;\n    path: string[];\n  }>('ZodFieldError')\n  .implement({\n    fields: (t) => ({\n      message: t.exposeString('message'),\n      path: t.exposeStringList('path'),\n    }),\n  });\n\n// The actual error type\nbuilder.objectType(ZodError, {\n  name: 'ZodError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof ZodError,\n  fields: (t) => ({\n    fieldErrors: t.field({\n      type: [ZodFieldError],\n      resolve: (err) => flattenErrors(err.format(), []),\n    }),\n  }),\n});\n\nbuilder.queryField('fieldWIthValidation', (t) =>\n  t.boolean({\n    errors: {\n      types: [ZodError],\n    },\n    args: {\n      string: t.arg.string({\n        validate: {\n          type: 'string',\n          minLength: 3,\n        },\n      }),\n    },\n    resolve: () => true,\n  }),\n);\n```\n\nExample query:\n\n```graphql\nquery {\n  validation(string: \"a\") {\n    __typename\n    ... on QueryValidationSuccess {\n      data\n    }\n    ... on ZodError {\n      fieldErrors {\n        message\n        path\n      }\n    }\n  }\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@0.0.0-preview-20217752147","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-88sylXL1Dvyg1SkkLJV7W0T3tq5fsXd37bp6TndZGGC81+jJ/SfEdgI5/eJy4uNQ3VE9Vsg5jsIY+KEHKS/94w==","shasum":"f559e5aa3f9f3996c02d7a2b1642888816b0a7b3","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-0.0.0-preview-20217752147.tgz","fileCount":23,"unpackedSize":89086,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDhh5CRA9TVsSAnZWagAAO9UP/jiKVIYIiMm6K3Co4ZJy\npzbNV/UePrWPxsQRIkRUkS9f2qkfrMT5+ltzs2jhUH76HZLT6zd0FhsUHQQd\nZU2knaFfbIE77NQ6Su62tD7eWqknuK3gQH/PajumoiSdIiVVwNlc7rg36nne\nP9KUaMkgNf10ukT8HRjjsBDckK53DB8dMlLeUYj8HGuc4Yin4AKCYj15jLS5\nQpt2TErWTI1Wh2JNSqErL9PNFyyaIge4maIsJ4V9SS54bDryv3Ub5VkgPz9G\nI/YZ3oNQ4+SxV2vzQC75IKLhQvSZrJfrBHVINwpn52XhRXwRdJLdR5bcd3Di\nsTqvycriwH2WSFoobBvPDpALcN9EAvs+hQe6Obt8QgSpvaOwcuQbSFlw1fT9\nMP+gDxP7AU2QRMWs++A4Ffzvf6ERhvYe8gLp0QkYNLuggEieJUCRBUHl351Q\n39T07RSVZO0GBkFn+MGEu/nUhSEL+yLIFITd0ihUecLD8uUeusGcLVfkBMHK\nNAIzKkW3kYipMz5Mq2dhI+VNOfAfNGcvPHMXHaKz5TrAefDSkyImBKiLSiKv\nmcbHbMATd4nAAzvolL3JSh+lK/RIGxl6wcQnrFOfiewyFBmhShA8RMrD8xxo\nXCSA5awqSpDjtmL7dkdU3qRFTUDAIab1S87Ry/nhFexVwaBRD3KZAeRIhiud\n237F\r\n=dlw0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDqu1kYT9pHkSaMkOnvwFRrBAN9o79XGnzT4uvNGKpbSAiEAheLAZd5YaoRhFt/3h0Ci0tViaTct4oEnr1EejAX3p9A="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_0.0.0-preview-20217752147_1628313721026_0.11579719511342157"},"_hasShrinkwrap":false},"0.0.0-preview-20217753333":{"name":"@giraphql/plugin-errors","version":"0.0.0-preview-20217753333","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^0.0.0-preview-20217753333","@giraphql/plugin-validation":"^0.0.0-preview-20217753333","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-0.0.0-preview-20217753333.tgz","readme":"# Errors Plugin\n\nA plugin for easily including error types in your GraphQL schema and hooking up error types to\nresolvers\n\n## Usage\n\n### Install\n\n```bash\nyarn add @giraphql/plugin-errors\n```\n\n### Setup\n\nEnsure that the target in your `tsconfig.json` is set to `es6` or higher (default is `es3`).\n\n### Example Ussage\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [],\n  },\n});\n\nbuilder.objectType(Error, {\n  name: 'Error',\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    hello: t.string({\n      errors: {\n        type: [Error],\n      },\n      args: {\n        name: t.arg.string({ required: false }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.slice(0, 1) !== name.slice(0, 1).toUpperCase()) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\nThe above example will produce a GraphQL schema that looks like:\n\n```graphql\ntype Error {\n  message: String!\n}\n\ntype Query {\n  hello(name: String!): QueryHelloResult\n}\n\nunion QueryExtendedErrorListOrError = Error | QueryHelloSuccess\n\ntype QueryHelloSuccess {\n  data: String!\n}\n```\n\nThis field can be queried using fragments like:\n\n```graphql\nquery {\n  hello(name: \"World\") {\n    __typename\n    ... on Error {\n      message\n    }\n    ... on QueryHelloSuccess {\n      data\n    }\n  }\n}\n```\n\nThis plugin works by wrapping fields that define error options in a union type. This union consists\nof an object type for each error type defined for the field, and a Success object type that wraps\nthe returned data. If the fields resolver throws an instance of one of the defined errors, the\nerrors plugin will automatically resolve to the corresponding error object type.\n\n### Builder options\n\n- `defaultTypes`: An array of Error classes to include in every field with error handling.\n\n### Options on Fields\n\n- `types`: An array of Error classes to catch and handle as error objects in the schema. Will be\n  merged with `defaultTypes` from builder.\n- `union`: An options object for the union type. Can include any normal union type options, and\n  `name` option for setting a custom name for the union type.\n- `result`: An options object for result object type. Can include any normal object type options,\n  and `name` option for setting a custom name for the result type.\n- `dataField`: An options object for the data field on the result object. This field will be named\n  `data` by default, but can be written by passsing a custom `name` option.\n\n### Recommended Ussage\n\n1. Set up an Error interface\n2. Create a BaseError object type\n3. Include the Error interface in any custom Error types you define\n4. Include the BaseError type in the `defaultTypes` in the builder config\n\nThis pattern will allow you to consistently query your schema using a `... on Error { message }`\nfragment since all Error classes extend that interface. If your client want's to query details of\nmore specialized error types, they can just add a fragment for the errors it cares about. This\npattern should also make it easier to make future changes without unexpected breaking changes for\nyour clients.\n\nThe follow is a small example of this pattern:\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [Error],\n  },\n});\n\nconst ErrorInterface = builder.interfaceRef<Error>('Error').implement({\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.objectType(Error, {\n  name: 'BaseError',\n  isTypeOf: (obj) => obj instanceof Error,\n  interfaces: [ErrorInterface],\n});\n\nclass LengthError extends Error {\n  minLength: number;\n\n  constructor(minLength: number) {\n    super(`string length should be at least ${minLength}`);\n\n    this.minLength = minLength;\n    this.name = 'LengthError';\n  }\n}\n\nbuilder.objectType(LengthError, {\n  name: 'LengthError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof LengthError,\n  fields: (t) => ({\n    minLength: t.exposeInt('minLength'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    // Simple error handling just using base error class\n    hello: t.string({\n      errors: {},\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (!name.startsWith(name.slice(0, 1).toUpperCase())) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n    // Handling custom errors\n    helloWithMinLength: t.string({\n      errors: {\n        types: [LengthError],\n      },\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.length < 5) {\n          throw new LengthError(5);\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\n### With validation plugin\n\nTo use this in combination with the validation plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nOnce your plugins are set up, you can define types for a ZodError, the same way you would for any\nother error type. Below is a simple example of how this can be done, but the specifics of how you\nstructure your error types are left up to you.\n\n```typescript\n// Util for flattening zod errors into something easier to represent in your Schema.\nfunction flattenErrors(\n  error: ZodFormattedError<unknown>,\n  path: string[],\n): { path: string[]; message: string }[] {\n  // eslint-disable-next-line no-underscore-dangle\n  const errors = error._errors.map((message) => ({\n    path,\n    message,\n  }));\n\n  Object.keys(error).forEach((key) => {\n    if (key !== '_errors') {\n      errors.push(\n        ...flattenErrors((error as Record<string, unknown>)[key] as ZodFormattedError<unknown>, [\n          ...path,\n          key,\n        ]),\n      );\n    }\n  });\n\n  return errors;\n}\n\n// A type for the individual validation issues\nconst ZodFieldError = builder\n  .objectRef<{\n    message: string;\n    path: string[];\n  }>('ZodFieldError')\n  .implement({\n    fields: (t) => ({\n      message: t.exposeString('message'),\n      path: t.exposeStringList('path'),\n    }),\n  });\n\n// The actual error type\nbuilder.objectType(ZodError, {\n  name: 'ZodError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof ZodError,\n  fields: (t) => ({\n    fieldErrors: t.field({\n      type: [ZodFieldError],\n      resolve: (err) => flattenErrors(err.format(), []),\n    }),\n  }),\n});\n\nbuilder.queryField('fieldWIthValidation', (t) =>\n  t.boolean({\n    errors: {\n      types: [ZodError],\n    },\n    args: {\n      string: t.arg.string({\n        validate: {\n          type: 'string',\n          minLength: 3,\n        },\n      }),\n    },\n    resolve: () => true,\n  }),\n);\n```\n\nExample query:\n\n```graphql\nquery {\n  validation(string: \"a\") {\n    __typename\n    ... on QueryValidationSuccess {\n      data\n    }\n    ... on ZodError {\n      fieldErrors {\n        message\n        path\n      }\n    }\n  }\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@0.0.0-preview-20217753333","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-DKhVkZkIbgiaCnvAZ390npTJ2zogqWUqGQKyLm2TpDjUVC7RyBcfUJe1VWf/o+hUTNLKaL7BnakQk4Qdr6u7BQ==","shasum":"f99fae4987c6b9a326e6f8485f72146e2639a9ae","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-0.0.0-preview-20217753333.tgz","fileCount":34,"unpackedSize":102101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDhs8CRA9TVsSAnZWagAAqEMQAJBy92sXMzf57R1sniz6\nRta/layNW14Uu3y6DG0PkaHxI5QynxcOHvjIOGwnzq74zpT+T3LxsE+77aJD\naO0zvyUjITET0hCwwMWQ3lRCWe4xA+9z5l3fntSxWwM4rjry5fD/hSeuZkFK\nHYKbYQOXJnFegud7fxg2t+FxomsfH7wJdECGqgx8w0orUykaIjXhnIMkTicu\nBPPPDGTE+Hm+cbMFOniFK+y+00t/CLv5RP9V0ZnMLD1XAsae+D0QgRQATU/z\nZPeePwLI124ReDluxe/KX+aknYllIL/um5oi9owemiDQsieKjCB6Eiw0LFZX\naSHG99UiYDT74hY86omXpIzylsTip5XNhfqMwzrUJO9lv6aBx/fXU9QhQ6iQ\n85e56lTyfe0bhXfhMzWAC8LGffnEhMSIzBRUYWBrBkWDarVBVJI/emiZX9KR\nzYT8FATsWzzACyoHOhmX6X9uMLRNjKxYR83bpTkF+sjNTjiuVxnLJ5vCuPYS\nNiZhdfWRMZnUoM0Fpp6uk0uM6/R6Qeiwi758c91PHLQy/Y73qhDF6JSqtPdv\n/ZFmBSQLlBPLfNoSp4854mpSkoNf6kgWt4UsbNsrL3cO9xtIJBAoKkOcck95\n+qQV3H599djaf5P2jZgZSQvanblzDa9I8rL2ILG1Me1CYHU5qb17uao9ZIsM\nzYRF\r\n=quuL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdbIRDUDq3AAMmfPXkJuKUj+zXYtdZuL9Y0LFCe3tVkQIgNcqmD4E73GW8wXMDIWVKiR2j+nVUtj1stLRYSdgLxuw="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_0.0.0-preview-20217753333_1628314427914_0.9341711694696408"},"_hasShrinkwrap":false},"0.0.0-preview-202178182932":{"name":"@giraphql/plugin-errors","version":"0.0.0-preview-202178182932","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^0.0.0-preview-202178182932","@giraphql/plugin-validation":"^0.0.0-preview-202178182932","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-0.0.0-preview-202178182932.tgz","readme":"# Errors Plugin\n\nA plugin for easily including error types in your GraphQL schema and hooking up error types to\nresolvers\n\n## Usage\n\n### Install\n\n```bash\nyarn add @giraphql/plugin-errors\n```\n\n### Setup\n\nEnsure that the target in your `tsconfig.json` is set to `es6` or higher (default is `es3`).\n\n### Example Ussage\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [],\n  },\n});\n\nbuilder.objectType(Error, {\n  name: 'Error',\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    hello: t.string({\n      errors: {\n        type: [Error],\n      },\n      args: {\n        name: t.arg.string({ required: false }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.slice(0, 1) !== name.slice(0, 1).toUpperCase()) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\nThe above example will produce a GraphQL schema that looks like:\n\n```graphql\ntype Error {\n  message: String!\n}\n\ntype Query {\n  hello(name: String!): QueryHelloResult\n}\n\nunion QueryExtendedErrorListOrError = Error | QueryHelloSuccess\n\ntype QueryHelloSuccess {\n  data: String!\n}\n```\n\nThis field can be queried using fragments like:\n\n```graphql\nquery {\n  hello(name: \"World\") {\n    __typename\n    ... on Error {\n      message\n    }\n    ... on QueryHelloSuccess {\n      data\n    }\n  }\n}\n```\n\nThis plugin works by wrapping fields that define error options in a union type. This union consists\nof an object type for each error type defined for the field, and a Success object type that wraps\nthe returned data. If the fields resolver throws an instance of one of the defined errors, the\nerrors plugin will automatically resolve to the corresponding error object type.\n\n### Builder options\n\n- `defaultTypes`: An array of Error classes to include in every field with error handling.\n\n### Options on Fields\n\n- `types`: An array of Error classes to catch and handle as error objects in the schema. Will be\n  merged with `defaultTypes` from builder.\n- `union`: An options object for the union type. Can include any normal union type options, and\n  `name` option for setting a custom name for the union type.\n- `result`: An options object for result object type. Can include any normal object type options,\n  and `name` option for setting a custom name for the result type.\n- `dataField`: An options object for the data field on the result object. This field will be named\n  `data` by default, but can be written by passsing a custom `name` option.\n\n### Recommended Ussage\n\n1. Set up an Error interface\n2. Create a BaseError object type\n3. Include the Error interface in any custom Error types you define\n4. Include the BaseError type in the `defaultTypes` in the builder config\n\nThis pattern will allow you to consistently query your schema using a `... on Error { message }`\nfragment since all Error classes extend that interface. If your client want's to query details of\nmore specialized error types, they can just add a fragment for the errors it cares about. This\npattern should also make it easier to make future changes without unexpected breaking changes for\nyour clients.\n\nThe follow is a small example of this pattern:\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [Error],\n  },\n});\n\nconst ErrorInterface = builder.interfaceRef<Error>('Error').implement({\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.objectType(Error, {\n  name: 'BaseError',\n  isTypeOf: (obj) => obj instanceof Error,\n  interfaces: [ErrorInterface],\n});\n\nclass LengthError extends Error {\n  minLength: number;\n\n  constructor(minLength: number) {\n    super(`string length should be at least ${minLength}`);\n\n    this.minLength = minLength;\n    this.name = 'LengthError';\n  }\n}\n\nbuilder.objectType(LengthError, {\n  name: 'LengthError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof LengthError,\n  fields: (t) => ({\n    minLength: t.exposeInt('minLength'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    // Simple error handling just using base error class\n    hello: t.string({\n      errors: {},\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (!name.startsWith(name.slice(0, 1).toUpperCase())) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n    // Handling custom errors\n    helloWithMinLength: t.string({\n      errors: {\n        types: [LengthError],\n      },\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.length < 5) {\n          throw new LengthError(5);\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\n### With validation plugin\n\nTo use this in combination with the validation plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nOnce your plugins are set up, you can define types for a ZodError, the same way you would for any\nother error type. Below is a simple example of how this can be done, but the specifics of how you\nstructure your error types are left up to you.\n\n```typescript\n// Util for flattening zod errors into something easier to represent in your Schema.\nfunction flattenErrors(\n  error: ZodFormattedError<unknown>,\n  path: string[],\n): { path: string[]; message: string }[] {\n  // eslint-disable-next-line no-underscore-dangle\n  const errors = error._errors.map((message) => ({\n    path,\n    message,\n  }));\n\n  Object.keys(error).forEach((key) => {\n    if (key !== '_errors') {\n      errors.push(\n        ...flattenErrors((error as Record<string, unknown>)[key] as ZodFormattedError<unknown>, [\n          ...path,\n          key,\n        ]),\n      );\n    }\n  });\n\n  return errors;\n}\n\n// A type for the individual validation issues\nconst ZodFieldError = builder\n  .objectRef<{\n    message: string;\n    path: string[];\n  }>('ZodFieldError')\n  .implement({\n    fields: (t) => ({\n      message: t.exposeString('message'),\n      path: t.exposeStringList('path'),\n    }),\n  });\n\n// The actual error type\nbuilder.objectType(ZodError, {\n  name: 'ZodError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof ZodError,\n  fields: (t) => ({\n    fieldErrors: t.field({\n      type: [ZodFieldError],\n      resolve: (err) => flattenErrors(err.format(), []),\n    }),\n  }),\n});\n\nbuilder.queryField('fieldWIthValidation', (t) =>\n  t.boolean({\n    errors: {\n      types: [ZodError],\n    },\n    args: {\n      string: t.arg.string({\n        validate: {\n          type: 'string',\n          minLength: 3,\n        },\n      }),\n    },\n    resolve: () => true,\n  }),\n);\n```\n\nExample query:\n\n```graphql\nquery {\n  validation(string: \"a\") {\n    __typename\n    ... on QueryValidationSuccess {\n      data\n    }\n    ... on ZodError {\n      fieldErrors {\n        message\n        path\n      }\n    }\n  }\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@0.0.0-preview-202178182932","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-wzkPY6HLCzo46ZGgi0yof9q6YJKxu+iryVuGHcJfuGWemgO0WJSjOa79KH4XgDSkiVpWz7z0mGR4HDleFTgz7Q==","shasum":"cd65530172ba55556aa996e6146c07b28b9a2a94","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-0.0.0-preview-202178182932.tgz","fileCount":34,"unpackedSize":102169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhECKdCRA9TVsSAnZWagAAALEP/iFiemw452vKV37avRPF\nosAzat3y51cLpfp41Dep0MnzlAZYSxABkJ7Piq9WfCS9JmUp0D2t/eFXnT6x\nbJsAa/ew9LNNoclDmOBR1YVbg+5fWRJ23Xu3+Vd5sQZbCKZlkI+lEeY3b5s7\nUamGvO8h1UHfpZQT3Hsb0TAiKdx/dNxnEau0sx+eSY+D0jqH7ZAyWs5G0V/W\nYub6JclRY72+9nYnMqS8GdGJLYtJVm0GFyXY3940rvofh6jpf9Q5MuTvyBen\n5tVPge7IIHTsH53cgqEthlhbRSYZhoircGKZUXI+aoN6ysgowsSLNeqm40Jq\nZs6tAVNXHhZiiEyq6vG/E8XkKZAPb985G/migHMtF/WgKEgxu7G2lViT/hdk\nCZH7okdbnmJLH4FJsXb5aicpGbfStRh++5bU0/4RXl0C+ZFFYkA0sCM4+wTh\nwtXyrKyTCyA7F/tMFEswIwj0QDe1YoGGQwoPEpNrZC0K7SXamOhq0iweMuhS\nDo0Y0Io0dp4E48bCO64cD+6nbIv1wyv1DZ2LKko82QV4k24yY8/u8o/1IaGg\nuCKEED7666OFEj8jJc3Uv/dTRdzcZTADvdrIQRi14zLn7la7nh2ZFfsRFuCf\ns3iIx/Q5PQGtFiBh8xgVvpdpJqARYkPu2k59S/LfQoNz+12e/44jEdrNPxl4\nGBnM\r\n=wqXm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH9VDXDj+oT1YVuUeCc6KXZ8Jf58/g0zIsMGD6ZMVTFPAiEAzjcgXewkgqN3S3MZR+p9yp/GXTMosswFmX/gSK0caxg="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_0.0.0-preview-202178182932_1628447388938_0.19741199979056856"},"_hasShrinkwrap":false},"0.0.0-preview-202178184810":{"name":"@giraphql/plugin-errors","version":"0.0.0-preview-202178184810","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^0.0.0-preview-202178184810","@giraphql/plugin-validation":"^0.0.0-preview-202178184810","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-0.0.0-preview-202178184810.tgz","readme":"# Errors Plugin\n\nA plugin for easily including error types in your GraphQL schema and hooking up error types to\nresolvers\n\n## Usage\n\n### Install\n\n```bash\nyarn add @giraphql/plugin-errors\n```\n\n### Setup\n\nEnsure that the target in your `tsconfig.json` is set to `es6` or higher (default is `es3`).\n\n### Example Ussage\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [],\n  },\n});\n\nbuilder.objectType(Error, {\n  name: 'Error',\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    hello: t.string({\n      errors: {\n        type: [Error],\n      },\n      args: {\n        name: t.arg.string({ required: false }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.slice(0, 1) !== name.slice(0, 1).toUpperCase()) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\nThe above example will produce a GraphQL schema that looks like:\n\n```graphql\ntype Error {\n  message: String!\n}\n\ntype Query {\n  hello(name: String!): QueryHelloResult\n}\n\nunion QueryExtendedErrorListOrError = Error | QueryHelloSuccess\n\ntype QueryHelloSuccess {\n  data: String!\n}\n```\n\nThis field can be queried using fragments like:\n\n```graphql\nquery {\n  hello(name: \"World\") {\n    __typename\n    ... on Error {\n      message\n    }\n    ... on QueryHelloSuccess {\n      data\n    }\n  }\n}\n```\n\nThis plugin works by wrapping fields that define error options in a union type. This union consists\nof an object type for each error type defined for the field, and a Success object type that wraps\nthe returned data. If the fields resolver throws an instance of one of the defined errors, the\nerrors plugin will automatically resolve to the corresponding error object type.\n\n### Builder options\n\n- `defaultTypes`: An array of Error classes to include in every field with error handling.\n\n### Options on Fields\n\n- `types`: An array of Error classes to catch and handle as error objects in the schema. Will be\n  merged with `defaultTypes` from builder.\n- `union`: An options object for the union type. Can include any normal union type options, and\n  `name` option for setting a custom name for the union type.\n- `result`: An options object for result object type. Can include any normal object type options,\n  and `name` option for setting a custom name for the result type.\n- `dataField`: An options object for the data field on the result object. This field will be named\n  `data` by default, but can be written by passsing a custom `name` option.\n\n### Recommended Ussage\n\n1. Set up an Error interface\n2. Create a BaseError object type\n3. Include the Error interface in any custom Error types you define\n4. Include the BaseError type in the `defaultTypes` in the builder config\n\nThis pattern will allow you to consistently query your schema using a `... on Error { message }`\nfragment since all Error classes extend that interface. If your client want's to query details of\nmore specialized error types, they can just add a fragment for the errors it cares about. This\npattern should also make it easier to make future changes without unexpected breaking changes for\nyour clients.\n\nThe follow is a small example of this pattern:\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [Error],\n  },\n});\n\nconst ErrorInterface = builder.interfaceRef<Error>('Error').implement({\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.objectType(Error, {\n  name: 'BaseError',\n  isTypeOf: (obj) => obj instanceof Error,\n  interfaces: [ErrorInterface],\n});\n\nclass LengthError extends Error {\n  minLength: number;\n\n  constructor(minLength: number) {\n    super(`string length should be at least ${minLength}`);\n\n    this.minLength = minLength;\n    this.name = 'LengthError';\n  }\n}\n\nbuilder.objectType(LengthError, {\n  name: 'LengthError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof LengthError,\n  fields: (t) => ({\n    minLength: t.exposeInt('minLength'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    // Simple error handling just using base error class\n    hello: t.string({\n      errors: {},\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (!name.startsWith(name.slice(0, 1).toUpperCase())) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n    // Handling custom errors\n    helloWithMinLength: t.string({\n      errors: {\n        types: [LengthError],\n      },\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.length < 5) {\n          throw new LengthError(5);\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\n### With validation plugin\n\nTo use this in combination with the validation plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nOnce your plugins are set up, you can define types for a ZodError, the same way you would for any\nother error type. Below is a simple example of how this can be done, but the specifics of how you\nstructure your error types are left up to you.\n\n```typescript\n// Util for flattening zod errors into something easier to represent in your Schema.\nfunction flattenErrors(\n  error: ZodFormattedError<unknown>,\n  path: string[],\n): { path: string[]; message: string }[] {\n  // eslint-disable-next-line no-underscore-dangle\n  const errors = error._errors.map((message) => ({\n    path,\n    message,\n  }));\n\n  Object.keys(error).forEach((key) => {\n    if (key !== '_errors') {\n      errors.push(\n        ...flattenErrors((error as Record<string, unknown>)[key] as ZodFormattedError<unknown>, [\n          ...path,\n          key,\n        ]),\n      );\n    }\n  });\n\n  return errors;\n}\n\n// A type for the individual validation issues\nconst ZodFieldError = builder\n  .objectRef<{\n    message: string;\n    path: string[];\n  }>('ZodFieldError')\n  .implement({\n    fields: (t) => ({\n      message: t.exposeString('message'),\n      path: t.exposeStringList('path'),\n    }),\n  });\n\n// The actual error type\nbuilder.objectType(ZodError, {\n  name: 'ZodError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof ZodError,\n  fields: (t) => ({\n    fieldErrors: t.field({\n      type: [ZodFieldError],\n      resolve: (err) => flattenErrors(err.format(), []),\n    }),\n  }),\n});\n\nbuilder.queryField('fieldWIthValidation', (t) =>\n  t.boolean({\n    errors: {\n      types: [ZodError],\n    },\n    args: {\n      string: t.arg.string({\n        validate: {\n          type: 'string',\n          minLength: 3,\n        },\n      }),\n    },\n    resolve: () => true,\n  }),\n);\n```\n\nExample query:\n\n```graphql\nquery {\n  validation(string: \"a\") {\n    __typename\n    ... on QueryValidationSuccess {\n      data\n    }\n    ... on ZodError {\n      fieldErrors {\n        message\n        path\n      }\n    }\n  }\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@0.0.0-preview-202178184810","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-VeWfufrUDaQqgm+Iz9aH8MROsRAh7Xn4HsQ4Tlwve06t7mT+9AC8Iqyh24XouZpIDRO54ph3fUe5ghBXIxbsOQ==","shasum":"2d84ab140570e55618f438f7aaa165ffd00a9adf","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-0.0.0-preview-202178184810.tgz","fileCount":34,"unpackedSize":102169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhECb4CRA9TVsSAnZWagAATNUQAKEUXQLBh5NFZfvOwVGc\naaEde0uNXnq2iJmROhOeSZuxPSRuDhJITrmrz9HAV7yujOHXp8B+M8BCiIFS\n+eUi+J0ekVzPJ5r4kaqIdlqazOIf3jfESVaADeLq5eVaghkH0OhxpkEwwkXu\nNjtAY0ek0sMpFf+PuBZpEBAj5mhFAAIzqJPPxU+khLLEIU5W+G7vXzapuMDh\ng148t8aDKGzmVkWC42OOUTcKOEAyamelHIrEswJ1jaQyU0O6Clkdeyw9ugev\nagHDQwWwfXLjZ4AgAjA49CvO7medsfP+ZsQR1mENHDGI37s4N5Nof1fR03lj\n58B8N27l8P64DKbMT0oGannnbgDVvU8wYh3SUntzFWHQWQKpD0IpP8WQ+lrh\nqhATxLECpIr45pu+AXuPjOqz9QGvZSyWwWRy2G/BBUIGy1vTLMkXF5lyvHi0\ndZk4nfdLpqg/IviUNJzIBhTV4aJgrS/GXIfQH7+oACp/nLepc6Kcah9x6rWu\nLB1kiP2TCysLiHBOMlLx3h5SZZQV1C8zbxihIa/D0EL1EgbeFQ5ZZt9IZR7V\nw1asMgQmVgcnaqfAME8tNnYpTGBfnlrKMqYY/zhWTxxrV+BoR/QMY8VwvBrB\nRqw3hqFqVWCkg67uRsHrAXjmvBmAE2KlVvkPvA7KKGRXNNB7PPW5lSEaOX7j\n83/q\r\n=Pqmo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUgvBhR4kFbd/n9K5Ga+fIVLKlhN6DY+1WhHvqd4GSygIgaQSdAArkbC6Hz5eQ57rZvbTUrBiMGXhTx8bseJrk0W8="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_0.0.0-preview-202178184810_1628448504374_0.48378445288298244"},"_hasShrinkwrap":false},"0.0.0-preview-202178194614":{"name":"@giraphql/plugin-errors","version":"0.0.0-preview-202178194614","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^0.0.0-preview-202178194614","@giraphql/plugin-validation":"^0.0.0-preview-202178194614","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-0.0.0-preview-202178194614.tgz","readme":"# Errors Plugin\n\nA plugin for easily including error types in your GraphQL schema and hooking up error types to\nresolvers\n\n## Usage\n\n### Install\n\n```bash\nyarn add @giraphql/plugin-errors\n```\n\n### Setup\n\nEnsure that the target in your `tsconfig.json` is set to `es6` or higher (default is `es3`).\n\n### Example Ussage\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [],\n  },\n});\n\nbuilder.objectType(Error, {\n  name: 'Error',\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    hello: t.string({\n      errors: {\n        type: [Error],\n      },\n      args: {\n        name: t.arg.string({ required: false }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.slice(0, 1) !== name.slice(0, 1).toUpperCase()) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\nThe above example will produce a GraphQL schema that looks like:\n\n```graphql\ntype Error {\n  message: String!\n}\n\ntype Query {\n  hello(name: String!): QueryHelloResult\n}\n\nunion QueryExtendedErrorListOrError = Error | QueryHelloSuccess\n\ntype QueryHelloSuccess {\n  data: String!\n}\n```\n\nThis field can be queried using fragments like:\n\n```graphql\nquery {\n  hello(name: \"World\") {\n    __typename\n    ... on Error {\n      message\n    }\n    ... on QueryHelloSuccess {\n      data\n    }\n  }\n}\n```\n\nThis plugin works by wrapping fields that define error options in a union type. This union consists\nof an object type for each error type defined for the field, and a Success object type that wraps\nthe returned data. If the fields resolver throws an instance of one of the defined errors, the\nerrors plugin will automatically resolve to the corresponding error object type.\n\n### Builder options\n\n- `defaultTypes`: An array of Error classes to include in every field with error handling.\n\n### Options on Fields\n\n- `types`: An array of Error classes to catch and handle as error objects in the schema. Will be\n  merged with `defaultTypes` from builder.\n- `union`: An options object for the union type. Can include any normal union type options, and\n  `name` option for setting a custom name for the union type.\n- `result`: An options object for result object type. Can include any normal object type options,\n  and `name` option for setting a custom name for the result type.\n- `dataField`: An options object for the data field on the result object. This field will be named\n  `data` by default, but can be written by passsing a custom `name` option.\n\n### Recommended Ussage\n\n1. Set up an Error interface\n2. Create a BaseError object type\n3. Include the Error interface in any custom Error types you define\n4. Include the BaseError type in the `defaultTypes` in the builder config\n\nThis pattern will allow you to consistently query your schema using a `... on Error { message }`\nfragment since all Error classes extend that interface. If your client want's to query details of\nmore specialized error types, they can just add a fragment for the errors it cares about. This\npattern should also make it easier to make future changes without unexpected breaking changes for\nyour clients.\n\nThe follow is a small example of this pattern:\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [Error],\n  },\n});\n\nconst ErrorInterface = builder.interfaceRef<Error>('Error').implement({\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.objectType(Error, {\n  name: 'BaseError',\n  isTypeOf: (obj) => obj instanceof Error,\n  interfaces: [ErrorInterface],\n});\n\nclass LengthError extends Error {\n  minLength: number;\n\n  constructor(minLength: number) {\n    super(`string length should be at least ${minLength}`);\n\n    this.minLength = minLength;\n    this.name = 'LengthError';\n  }\n}\n\nbuilder.objectType(LengthError, {\n  name: 'LengthError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof LengthError,\n  fields: (t) => ({\n    minLength: t.exposeInt('minLength'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    // Simple error handling just using base error class\n    hello: t.string({\n      errors: {},\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (!name.startsWith(name.slice(0, 1).toUpperCase())) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n    // Handling custom errors\n    helloWithMinLength: t.string({\n      errors: {\n        types: [LengthError],\n      },\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.length < 5) {\n          throw new LengthError(5);\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\n### With validation plugin\n\nTo use this in combination with the validation plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nOnce your plugins are set up, you can define types for a ZodError, the same way you would for any\nother error type. Below is a simple example of how this can be done, but the specifics of how you\nstructure your error types are left up to you.\n\n```typescript\n// Util for flattening zod errors into something easier to represent in your Schema.\nfunction flattenErrors(\n  error: ZodFormattedError<unknown>,\n  path: string[],\n): { path: string[]; message: string }[] {\n  // eslint-disable-next-line no-underscore-dangle\n  const errors = error._errors.map((message) => ({\n    path,\n    message,\n  }));\n\n  Object.keys(error).forEach((key) => {\n    if (key !== '_errors') {\n      errors.push(\n        ...flattenErrors((error as Record<string, unknown>)[key] as ZodFormattedError<unknown>, [\n          ...path,\n          key,\n        ]),\n      );\n    }\n  });\n\n  return errors;\n}\n\n// A type for the individual validation issues\nconst ZodFieldError = builder\n  .objectRef<{\n    message: string;\n    path: string[];\n  }>('ZodFieldError')\n  .implement({\n    fields: (t) => ({\n      message: t.exposeString('message'),\n      path: t.exposeStringList('path'),\n    }),\n  });\n\n// The actual error type\nbuilder.objectType(ZodError, {\n  name: 'ZodError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof ZodError,\n  fields: (t) => ({\n    fieldErrors: t.field({\n      type: [ZodFieldError],\n      resolve: (err) => flattenErrors(err.format(), []),\n    }),\n  }),\n});\n\nbuilder.queryField('fieldWIthValidation', (t) =>\n  t.boolean({\n    errors: {\n      types: [ZodError],\n    },\n    args: {\n      string: t.arg.string({\n        validate: {\n          type: 'string',\n          minLength: 3,\n        },\n      }),\n    },\n    resolve: () => true,\n  }),\n);\n```\n\nExample query:\n\n```graphql\nquery {\n  validation(string: \"a\") {\n    __typename\n    ... on QueryValidationSuccess {\n      data\n    }\n    ... on ZodError {\n      fieldErrors {\n        message\n        path\n      }\n    }\n  }\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@0.0.0-preview-202178194614","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-a4Lbp9yfLPUbX28Ui2eRioE/OJYmky7k7FOXVH2wWUwjUbFY6dyx+9rvEdN8fpmeJdxqhYH8ZFhnXwAUtUlf7w==","shasum":"dff25d717afc7a86fc9fdb75f4aeec1dc2453db8","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-0.0.0-preview-202178194614.tgz","fileCount":34,"unpackedSize":102169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEDSUCRA9TVsSAnZWagAA4rEP/ijZLVqK1ErybVxCUVwR\ntxkrl5tl4Hde8xEqbdRBK3DVxYLdh1zc49ItE2gfV7YsqORgMEl0PG4b2Qqq\nBvsLL/QgGRPTZVELYK2sIgJg+MkhSvv96lFVKWcsPl6G214MTAIprnr/F368\nvFtFE1ydiGOKvAjN2cGsMpCPvZDz8n5Ye+ZJ9ntMuLl/MoqQHWkQXvYRw9ht\npbQ4HQgakS5fvriyaZfw1VnM1Dni7w5Nm33+E3cV69S+z4e3dVCmBzw14mJA\neb7OeQQwTSChG3cISZNYNcsSvmLpHW8hjhuH2zY+NP47osjOiuINi57EDXee\n3/Gllc0weJ9DOFOVGssOqKYZNnyzCuM0BYe0/yKdNwBKt4VDltGHTicIwKC8\nX7+JrM4HPk/PlxscjfArjDEau4yUluofbWq8r1hK57MeAzq7MHKsEBVroKMy\nhaAkpXcCmCTAhFmjBQQvBK/J/8tLld/IgIH2w5Bkm+O4TI9vvqAXQ1gIQHI7\n78l5qErYQYW/tULi8dJ8R194MFyspBuuptcxrsqIxzqXOOFZj02eZpim8NJV\ns/e+v7XfKnPB49MlNzMb4PHlESOhEUoFYo4KmIiWQdI7ofhycJQQZRCukzt3\nyNzCPRO39nH2+K2InWY3Mr3eZqHpzOpSjgPSYUquISMqlMxAtS2HHO4kbhn4\nsD75\r\n=9gaG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFWMCJWU9o0jeTtiY0CxHLH5ePM2s3D52C38EvfmlW61AiBibfSDQSHP3YNrKAjEdE+PBf+1ag5j3qyXi+Z6o5fqLQ=="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_0.0.0-preview-202178194614_1628451988802_0.6712596752347113"},"_hasShrinkwrap":false},"2.5.0":{"name":"@giraphql/plugin-errors","version":"2.5.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.14.0","@giraphql/plugin-validation":"^2.9.0","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.5.0.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.5.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-5JeEqJT/JyMMxGu9kb8R+ITO4ODiF/1AGbs12WIkR+5qlXPC/DycBKdpSwZgYCjOqq1tNxz5NjX/BjKx6gmbKw==","shasum":"8396aa9b7b33564e2fe21fa46965224e5e61d70f","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.5.0.tgz","fileCount":34,"unpackedSize":102088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEDcfCRA9TVsSAnZWagAAV5AQAJOjeE1fSTdIvpmg+etR\nV8yYbng2F4GnZnxv+52z+Ew1vbQpx4m/D6UotptUoHoHAC8iKUC3G4lGI7r2\nNJl8fezKHYsZz4e1c5L25b4BvnYDFXY8BwdvGD6Lyv3irEiIPXZQ0Sk6piQm\n4B2EMPld1YZvt6vEe1IdTtHRabbMa3/5N1A/OKvWG3JFrVPxiMjfhZCAJs7L\nDPPQBlbXGlUoVo2Fipk3pgGrSEfs788eqjXHhZ2fN5RLAtuQ/1s+6Loz6VQx\ncTnuYmIaoZ5BbdPSE1trGwI2g9OqZvfWQndXrWRBgbk/mUEUF5nmnJlVBDsR\nzhbLJ+19En3mTzEOJn6iHIUwS2juMXmOjhIJdHbaLmV84VyZ1blPaE/WhcCo\n8ZHNtqc6EjbYMWgQe1gL64lDFm9IOuDKPpD0ojA3Hg4nzWRbWkIGWAP0LO9G\n5nT4RzwPV4eXWXgxsEbM14IoooOjgC5vSkV2cpv8UtLTF439z+VWGGIix9AB\nfFVRH+GqdRK2GbfkvoqqWDp8y0Llwhv1RP6iAosMGvR3XEDte3DH82J+7iKb\nb2GlUrY6Ridl8edyVPeZp3CP7TFqZ1huB8mtPvvVhVc9vHN9pKBm3lIvgfif\n1/uN77/uhCAxHzEZCleZwWrUAcWtCFUOyTz8NgnlwmlVxoViCNc996j7TEFw\n8zTF\r\n=xI8y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtlB7K6gA5yJGLkSB4f505h6CuTn3iI0cqs5h14qy6EQIgfZnDdjh32PqIguuBVYiJeTIsCATi4HtLqIz9NBA1Thc="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.5.0_1628452639416_0.17606335267022466"},"_hasShrinkwrap":false},"0.0.0-preview-202179204139":{"name":"@giraphql/plugin-errors","version":"0.0.0-preview-202179204139","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^0.0.0-preview-202179204139","@giraphql/plugin-validation":"^0.0.0-preview-202179204139","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-0.0.0-preview-202179204139.tgz","readme":"# Errors Plugin\n\nA plugin for easily including error types in your GraphQL schema and hooking up error types to\nresolvers\n\n## Usage\n\n### Install\n\n```bash\nyarn add @giraphql/plugin-errors\n```\n\n### Setup\n\nEnsure that the target in your `tsconfig.json` is set to `es6` or higher (default is `es3`).\n\n### Example Ussage\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [],\n  },\n});\n\nbuilder.objectType(Error, {\n  name: 'Error',\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    hello: t.string({\n      errors: {\n        type: [Error],\n      },\n      args: {\n        name: t.arg.string({ required: false }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.slice(0, 1) !== name.slice(0, 1).toUpperCase()) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\nThe above example will produce a GraphQL schema that looks like:\n\n```graphql\ntype Error {\n  message: String!\n}\n\ntype Query {\n  hello(name: String!): QueryHelloResult\n}\n\nunion QueryExtendedErrorListOrError = Error | QueryHelloSuccess\n\ntype QueryHelloSuccess {\n  data: String!\n}\n```\n\nThis field can be queried using fragments like:\n\n```graphql\nquery {\n  hello(name: \"World\") {\n    __typename\n    ... on Error {\n      message\n    }\n    ... on QueryHelloSuccess {\n      data\n    }\n  }\n}\n```\n\nThis plugin works by wrapping fields that define error options in a union type. This union consists\nof an object type for each error type defined for the field, and a Success object type that wraps\nthe returned data. If the fields resolver throws an instance of one of the defined errors, the\nerrors plugin will automatically resolve to the corresponding error object type.\n\n### Builder options\n\n- `defaultTypes`: An array of Error classes to include in every field with error handling.\n\n### Options on Fields\n\n- `types`: An array of Error classes to catch and handle as error objects in the schema. Will be\n  merged with `defaultTypes` from builder.\n- `union`: An options object for the union type. Can include any normal union type options, and\n  `name` option for setting a custom name for the union type.\n- `result`: An options object for result object type. Can include any normal object type options,\n  and `name` option for setting a custom name for the result type.\n- `dataField`: An options object for the data field on the result object. This field will be named\n  `data` by default, but can be written by passsing a custom `name` option.\n\n### Recommended Ussage\n\n1. Set up an Error interface\n2. Create a BaseError object type\n3. Include the Error interface in any custom Error types you define\n4. Include the BaseError type in the `defaultTypes` in the builder config\n\nThis pattern will allow you to consistently query your schema using a `... on Error { message }`\nfragment since all Error classes extend that interface. If your client want's to query details of\nmore specialized error types, they can just add a fragment for the errors it cares about. This\npattern should also make it easier to make future changes without unexpected breaking changes for\nyour clients.\n\nThe follow is a small example of this pattern:\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [Error],\n  },\n});\n\nconst ErrorInterface = builder.interfaceRef<Error>('Error').implement({\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.objectType(Error, {\n  name: 'BaseError',\n  isTypeOf: (obj) => obj instanceof Error,\n  interfaces: [ErrorInterface],\n});\n\nclass LengthError extends Error {\n  minLength: number;\n\n  constructor(minLength: number) {\n    super(`string length should be at least ${minLength}`);\n\n    this.minLength = minLength;\n    this.name = 'LengthError';\n  }\n}\n\nbuilder.objectType(LengthError, {\n  name: 'LengthError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof LengthError,\n  fields: (t) => ({\n    minLength: t.exposeInt('minLength'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    // Simple error handling just using base error class\n    hello: t.string({\n      errors: {},\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (!name.startsWith(name.slice(0, 1).toUpperCase())) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n    // Handling custom errors\n    helloWithMinLength: t.string({\n      errors: {\n        types: [LengthError],\n      },\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.length < 5) {\n          throw new LengthError(5);\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\n### With validation plugin\n\nTo use this in combination with the validation plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nOnce your plugins are set up, you can define types for a ZodError, the same way you would for any\nother error type. Below is a simple example of how this can be done, but the specifics of how you\nstructure your error types are left up to you.\n\n```typescript\n// Util for flattening zod errors into something easier to represent in your Schema.\nfunction flattenErrors(\n  error: ZodFormattedError<unknown>,\n  path: string[],\n): { path: string[]; message: string }[] {\n  // eslint-disable-next-line no-underscore-dangle\n  const errors = error._errors.map((message) => ({\n    path,\n    message,\n  }));\n\n  Object.keys(error).forEach((key) => {\n    if (key !== '_errors') {\n      errors.push(\n        ...flattenErrors((error as Record<string, unknown>)[key] as ZodFormattedError<unknown>, [\n          ...path,\n          key,\n        ]),\n      );\n    }\n  });\n\n  return errors;\n}\n\n// A type for the individual validation issues\nconst ZodFieldError = builder\n  .objectRef<{\n    message: string;\n    path: string[];\n  }>('ZodFieldError')\n  .implement({\n    fields: (t) => ({\n      message: t.exposeString('message'),\n      path: t.exposeStringList('path'),\n    }),\n  });\n\n// The actual error type\nbuilder.objectType(ZodError, {\n  name: 'ZodError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof ZodError,\n  fields: (t) => ({\n    fieldErrors: t.field({\n      type: [ZodFieldError],\n      resolve: (err) => flattenErrors(err.format(), []),\n    }),\n  }),\n});\n\nbuilder.queryField('fieldWIthValidation', (t) =>\n  t.boolean({\n    errors: {\n      types: [ZodError],\n    },\n    args: {\n      string: t.arg.string({\n        validate: {\n          type: 'string',\n          minLength: 3,\n        },\n      }),\n    },\n    resolve: () => true,\n  }),\n);\n```\n\nExample query:\n\n```graphql\nquery {\n  validation(string: \"a\") {\n    __typename\n    ... on QueryValidationSuccess {\n      data\n    }\n    ... on ZodError {\n      fieldErrors {\n        message\n        path\n      }\n    }\n  }\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@0.0.0-preview-202179204139","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-gm6/HHHn6YNe6ohnIfwlFc38V3S6cn1F/2zizLyIFDgulrk0/Ki0ALzBss9/8egVDbv5sRwYUIZhksJ6MqF26w==","shasum":"87e54ed01a2b2bdbebd30468a5b9adffd8a1d5ba","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-0.0.0-preview-202179204139.tgz","fileCount":34,"unpackedSize":102169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEZMTCRA9TVsSAnZWagAAlHoP/0F18DXpb0cwCne5cfmp\n9k79tbSIOfZ2ylXCzkkm2Muu4fl8WjI4XMCwXCvpdEbnt15PgQYGP3wdM6Og\nXrzI/AOD2ZF9qgJfE7EmMymR6SXmKSVTuAMypqaTjaOCJ3PoBxlLbKDuS8iK\nDXQyrIn63JQDXJlDcB72p08loAQ3u37kduJ+D57DUzagChZKeK+lq/CVMZoa\nBrCf62CV/kqgMm9C3WfspojV6dlqCgdAA8vY3S/vrW8hGj7nSQNe8/FXMSqX\n1ZQRZbRsKUi0EbWsSj6zSOg2kiDIHE/PbNUVUK+0yyo6MrvF/VYXoU1s+DuL\noJUFLdZ+l7osDC+92dZxHa10vL3cPRkhLc5cRJssF+hkAOAHNj9Jghh45/P0\n9w5OnCmQJOle33GFxxKVjYnk3MFPjOIhNGv3PDAXUUgy924k+lAQdpxRdsTK\n7hkH1hTapEpXvq2hdk30yZN5ZOClRzzyFtXIJVhpaSFu0u7c+e3cHm2nI2B7\nT1KCk7y1kTFfYcl7KKbmTm1sBt9LcmuYWmpvrLdeCpM9mRCclEEYW3ajfEC8\nFDdQWe/x9y2jvwxHI6Zdl4WuNkKcWiQTLZzjm3LCoVfLEdpiO5aQ5C1kg3Ec\nfG6qwn8dFkevdeeEBVXloQ6+jfrh5FQsWCV4nA+NOhgEuykFJ67hKxev9t48\nJxID\r\n=FYvX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICpfjQdpAp0goCAjCYPDjOa6kJM3riKGC9LbIl+yqcQsAiBj+a7auZK2YYgh8zNfW32dzc9uxxabMI/hhSAfHz0S9Q=="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_0.0.0-preview-202179204139_1628541715371_0.8050898079398934"},"_hasShrinkwrap":false},"2.6.0":{"name":"@giraphql/plugin-errors","version":"2.6.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.14.0","@giraphql/plugin-validation":"^2.9.0","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.6.0.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.6.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-2xrUhYgelmrO5oD2xTfyK2kzOFl4Ec37aQZmlIf0qzKOj+akpsAl5bjlIrnvxsfPOvA+7odInhsjxD9Z8skHtg==","shasum":"100d1048672002f64d6f9f29e65a3d6ea4f70307","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.6.0.tgz","fileCount":34,"unpackedSize":104814,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFauCCRA9TVsSAnZWagAAGiAP/RPLsHCAI+V7sSRH3XhB\neW1cqNqF8Gkk9MXoKkGPtY9if+Yo83fG4ExTfGgRuWhHICA1Pmw/NcV28BwR\nWEitoj84NIU7qPGMcW/ydxITIgKsIl6hMpFpoOPNXAF6a2OS3nCrQ2x3Qj3c\nv8cF9ptUv/fqW1eNyv9pT9DT7kbtX1M4xNubxSRHY806OrYfb4Rbgja8AinZ\nOM7OvxAuoVZ0XK+PINYwvs8GeTbBHQmrYimsi1S8Ui61DQhViE2LjaQaCScQ\ntaGHzswoP/fyTtkY3Jkaw8HSziPUyqAkaR6KJyfV565h7r0eWiXrjODdhxww\n4Myvi9za+hkP5oJu1pxT/N/QiAyxvtpvIJhwX1ZFu+Y3gLNgFlB/JX25LHZS\nXpY4C95UXFjFO98LfjFZIJhVvz9eJybKoRmm7pesLxzCrGuQVJdlA4lPQjQR\n68WvBQBmaGYknHaeCO19nsMQKaFKm3ApHLIarLzubyj4aYR8XOitjDK2G8WZ\nfm7r1Pksi3YH4RhLBoZE04o6Yvhwca8Gd5Ch1/5XEohUW4q1j0elQ2XxuR4Q\ncMTOfBbH6rPHAZxAIVBhe4wT9OkHrvhpYWKWsrn0RPPDnrjbumZXn5vmXIZ1\ncWHZQhM3Zn8BlI09pMyddGm7c+mWAVh/Dbf4SVVS0FvGoxyGmm2hW6mgW/tn\nVxTz\r\n=cK7S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDG4TiDuXN44Qg67W9ucP1Fh0C/XRqd/X+G1s9aBX1YeAiEAh64wIkhZyGTOr5f2HjVHb8QKCmX4lTCWQmvOdyL9vlg="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.6.0_1628810114694_0.660249135509265"},"_hasShrinkwrap":false},"2.7.0":{"name":"@giraphql/plugin-errors","version":"2.7.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.14.0","@giraphql/plugin-validation":"^2.9.0","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.7.0.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.7.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-QB09fHDGXLT6kXcbqT3gp+rW+wgNphbPmrtR1H3Ux+rzEKvNElVMqWc+g1jZzL9LfXMuOzqE6qHUSzauOCFMmw==","shasum":"72dfc50e5aa45f1e7cdabb192a3268f093e7423c","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.7.0.tgz","fileCount":34,"unpackedSize":106023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFdA1CRA9TVsSAnZWagAAIZ0P/RzZAcR5aF93zsV/Srq8\nhTonWWDmH39QrL4dYVqilr1CkVYLy/rt4tmkUuUcvGF3QGepyCfe1xwoTi9m\nWGFuE6owlcMfKBkqsjL/xjVNXSZbum+TSFr0qhRFS5O1L8wEiSg8r57lK7By\n87y1jn9mbvHxVd2jofywBwYQ0Ix+T9xbVjsEP+BmtEvpIXWRN+iYLlxfcwr2\n81dhFMhUqi1GmNeL9nKTGTn5DC+9lUMdFDcPv1vkAx0ZgKHAiKCPk26ZGRfF\n+me/6v7tY87qkFcgIBpZ2gj4avyQw2c3VkPrACzr0DuZlB3OGG2bVQcnRLaa\nRX1jHR/WW/enWbt3w8WM+mxU2gr+HWkpeaflSPb04TJyDZ+qGpXnA0/QlF0P\nIeIuPKRe+iTgM/VdQdIpmYx97h4z5omSwIHcP+28pzibdmiUj3gwdX86xWs2\nKFhlMZEjOV97RZhZ95hlCXOzA3d1UHzTDmZe93zGR8qcs0atZk4ii5k8mlzB\nQNB9uqIvDxbnKM8phrzupnlrVjsIeNrVabrEKCVm9mgzkiCDyD0R+ovVCXpY\nctHM538NZ3pCxb/2xaWc+VIT5UwgE7T0njug5iSOAXzwLIS1544Q/HSm50mw\nVfV3Uo3fJ6NGcvDkfTW3d134oOeJCRJRSvp0rcoN9BtrCsd6Ve5yG1L1Aw30\n/XvJ\r\n=/99E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUq5bdju0r8UBpcHpfJWTablAMAw2X59VsW9/mrfyeGAIgIgGit2qsMXn6lLlSpPrs43GCl5KNxJixFKMFRT17Pxk="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.7.0_1628819509353_0.22387616042154246"},"_hasShrinkwrap":false},"0.0.0-preview-2021724203738":{"name":"@giraphql/plugin-errors","version":"0.0.0-preview-2021724203738","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^0.0.0-preview-2021724203738","@giraphql/plugin-validation":"^0.0.0-preview-2021724203738","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-0.0.0-preview-2021724203738.tgz","readme":"# Errors Plugin\n\nA plugin for easily including error types in your GraphQL schema and hooking up error types to\nresolvers\n\n## Usage\n\n### Install\n\n```bash\nyarn add @giraphql/plugin-errors\n```\n\n### Setup\n\nEnsure that the target in your `tsconfig.json` is set to `es6` or higher (default is `es3`).\n\n### Example Usage\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [],\n  },\n});\n\nbuilder.objectType(Error, {\n  name: 'Error',\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    hello: t.string({\n      errors: {\n        types: [Error],\n      },\n      args: {\n        name: t.arg.string({ required: false }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.slice(0, 1) !== name.slice(0, 1).toUpperCase()) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\nThe above example will produce a GraphQL schema that looks like:\n\n```graphql\ntype Error {\n  message: String!\n}\n\ntype Query {\n  hello(name: String!): QueryHelloResult\n}\n\nunion QueryHelloResult = Error | QueryHelloSuccess\n\ntype QueryHelloSuccess {\n  data: String!\n}\n```\n\nThis field can be queried using fragments like:\n\n```graphql\nquery {\n  hello(name: \"World\") {\n    __typename\n    ... on Error {\n      message\n    }\n    ... on QueryHelloSuccess {\n      data\n    }\n  }\n}\n```\n\nThis plugin works by wrapping fields that define error options in a union type. This union consists\nof an object type for each error type defined for the field, and a Success object type that wraps\nthe returned data. If the fields resolver throws an instance of one of the defined errors, the\nerrors plugin will automatically resolve to the corresponding error object type.\n\n### Builder options\n\n- `defaultTypes`: An array of Error classes to include in every field with error handling.\n\n### Options on Fields\n\n- `types`: An array of Error classes to catch and handle as error objects in the schema. Will be\n  merged with `defaultTypes` from builder.\n- `union`: An options object for the union type. Can include any normal union type options, and\n  `name` option for setting a custom name for the union type.\n- `result`: An options object for result object type. Can include any normal object type options,\n  and `name` option for setting a custom name for the result type.\n- `dataField`: An options object for the data field on the result object. This field will be named\n  `data` by default, but can be written by passsing a custom `name` option.\n\n### Recommended Ussage\n\n1. Set up an Error interface\n2. Create a BaseError object type\n3. Include the Error interface in any custom Error types you define\n4. Include the BaseError type in the `defaultTypes` in the builder config\n\nThis pattern will allow you to consistently query your schema using a `... on Error { message }`\nfragment since all Error classes extend that interface. If your client want's to query details of\nmore specialized error types, they can just add a fragment for the errors it cares about. This\npattern should also make it easier to make future changes without unexpected breaking changes for\nyour clients.\n\nThe follow is a small example of this pattern:\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [Error],\n  },\n});\n\nconst ErrorInterface = builder.interfaceRef<Error>('Error').implement({\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.objectType(Error, {\n  name: 'BaseError',\n  isTypeOf: (obj) => obj instanceof Error,\n  interfaces: [ErrorInterface],\n});\n\nclass LengthError extends Error {\n  minLength: number;\n\n  constructor(minLength: number) {\n    super(`string length should be at least ${minLength}`);\n\n    this.minLength = minLength;\n    this.name = 'LengthError';\n  }\n}\n\nbuilder.objectType(LengthError, {\n  name: 'LengthError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof LengthError,\n  fields: (t) => ({\n    minLength: t.exposeInt('minLength'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    // Simple error handling just using base error class\n    hello: t.string({\n      errors: {},\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (!name.startsWith(name.slice(0, 1).toUpperCase())) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n    // Handling custom errors\n    helloWithMinLength: t.string({\n      errors: {\n        types: [LengthError],\n      },\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.length < 5) {\n          throw new LengthError(5);\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\n### With validation plugin\n\nTo use this in combination with the validation plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nOnce your plugins are set up, you can define types for a ZodError, the same way you would for any\nother error type. Below is a simple example of how this can be done, but the specifics of how you\nstructure your error types are left up to you.\n\n```typescript\n// Util for flattening zod errors into something easier to represent in your Schema.\nfunction flattenErrors(\n  error: ZodFormattedError<unknown>,\n  path: string[],\n): { path: string[]; message: string }[] {\n  // eslint-disable-next-line no-underscore-dangle\n  const errors = error._errors.map((message) => ({\n    path,\n    message,\n  }));\n\n  Object.keys(error).forEach((key) => {\n    if (key !== '_errors') {\n      errors.push(\n        ...flattenErrors((error as Record<string, unknown>)[key] as ZodFormattedError<unknown>, [\n          ...path,\n          key,\n        ]),\n      );\n    }\n  });\n\n  return errors;\n}\n\n// A type for the individual validation issues\nconst ZodFieldError = builder\n  .objectRef<{\n    message: string;\n    path: string[];\n  }>('ZodFieldError')\n  .implement({\n    fields: (t) => ({\n      message: t.exposeString('message'),\n      path: t.exposeStringList('path'),\n    }),\n  });\n\n// The actual error type\nbuilder.objectType(ZodError, {\n  name: 'ZodError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof ZodError,\n  fields: (t) => ({\n    fieldErrors: t.field({\n      type: [ZodFieldError],\n      resolve: (err) => flattenErrors(err.format(), []),\n    }),\n  }),\n});\n\nbuilder.queryField('fieldWIthValidation', (t) =>\n  t.boolean({\n    errors: {\n      types: [ZodError],\n    },\n    args: {\n      string: t.arg.string({\n        validate: {\n          type: 'string',\n          minLength: 3,\n        },\n      }),\n    },\n    resolve: () => true,\n  }),\n);\n```\n\nExample query:\n\n```graphql\nquery {\n  validation(string: \"a\") {\n    __typename\n    ... on QueryValidationSuccess {\n      data\n    }\n    ... on ZodError {\n      fieldErrors {\n        message\n        path\n      }\n    }\n  }\n}\n```\n\n### With the dataloader plugin\n\nTo use this in combination with the dataloader plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nIf a field with `errors` returns a `loadableObject`, or `loadableNode` the errors plugin will now\ncatch errors thrown when loading ids returned by the `resolve` function.\n\nplugin. This is because if items are nullable, the items in the list may be set to null rather that\nIf the field is a `List` field, errors that occur when resolving objects from `ids` will not be\nhandled by the errors plugin. This is because those errors are associated with each item in the list\nrather than the list field itself. In the future, the dataloader plugin may have an option to throw\nan error at the field level if any items can not be loaded, which would allow the error plugin to\nhandle these types of errors.\n\n### With the prisma plugin\n\nTo use this in combination with the prisma plugin, ensure that that errors plugin is listed BEFORE\nthe validation plugin in your plugin list. This will enable `errors` option to work work correctly\nwith any field builder method from the prisma plugin.\n\n`errors` can be configured for any field, but if there is an error pre-loading a relation the error\nwill always surfaced at the field that executed the query. Because there are cases that fall back to\nexecuting queries for relation fields, these fields may still have errors if the relation was not\npre-loaded. Detection of nested relations will continue to work if those relations use the `errors`\nplugin\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@0.0.0-preview-2021724203738","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-Zj8wKrbRwDunIprA1e22A2jqYXIrj2PzHicCqgHqzen6t/i2YDjCE6Nk00DpdCPkvcHB07ibgCCUGKSOZIYN8A==","shasum":"6518b40ad7722cbb3242f2a8e676b3221e146e31","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-0.0.0-preview-2021724203738.tgz","fileCount":34,"unpackedSize":108144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJViiCRA9TVsSAnZWagAAKXUP/3zSVLiVXz3jA7xiDibD\nCu7xP9pFeGBlkPphhytRZTjC6yyjWLOCrbOF8e+XhAdnktTAR2a3nDR804Jx\n0c/qoisxaTuM+d8kQKfRUBMIqJfG4V4J0iOp+qzQJ30hFUHDO2RltPXVTnY/\ndGZjKsvmEJXXbUOl1pRRDR1IZ417UlJIk8ZbIQom2X23lWJ38zv9OuNz7vNL\nlhlN8mvJmsC5xEId7yyWls8y8QBKP62xGwTqnrySSvXj7U8EQ4oOpYcQmM+W\nVVrumJKAKhMzpesbk89CxbkYNa6cEdkQcwr296T4feOeNzHgvpfxbFkFg+6p\nfxqNxl4lFqyKHec21BYUNh+jGZBbMBOwC4OHbktEwUoUIwlGqI9/YLQZqOa2\nTGvLCBGkWHnu2j4ZSEf21VrGS8GPbUFrVcaTdadmHyhDIUIdXfbBfgT4z0PU\nVqAP7upFrp6r8htFzEc0IgLXq9kYikw91Naf5dn9Py9WXCXQQ3Jt6u9/c9KJ\n2A8eimV11PVbNotq5AG/gngNPXefAJiAmbphnjKmPWKu/WKn/qHIRcLm/VWh\n5jjNUx6ZWIE93QZp4zwut0ZdAmtw+yZ8R/AH7s/Z71DKlbRK9LveWB9stKKv\nf2qQamTNabkGyy85Y8xQns1/x4727C1HEPG4qd+Tm9xtYigYa2Dnl82y6vO2\nRyyD\r\n=RMa9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID32PCclIrk7FewCrpMVVPhQWd731g7847ecKYArttl+AiBa2LdP24hWs/ypGT2M+ys3ibsaxdEPe27W9xRyBkJWtg=="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_0.0.0-preview-2021724203738_1629837474404_0.10436956887377224"},"_hasShrinkwrap":false},"0.0.0-preview-202172532716":{"name":"@giraphql/plugin-errors","version":"0.0.0-preview-202172532716","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^0.0.0-preview-202172532716","@giraphql/plugin-validation":"^0.0.0-preview-202172532716","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-0.0.0-preview-202172532716.tgz","readme":"# Errors Plugin\n\nA plugin for easily including error types in your GraphQL schema and hooking up error types to\nresolvers\n\n## Usage\n\n### Install\n\n```bash\nyarn add @giraphql/plugin-errors\n```\n\n### Setup\n\nEnsure that the target in your `tsconfig.json` is set to `es6` or higher (default is `es3`).\n\n### Example Usage\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [],\n  },\n});\n\nbuilder.objectType(Error, {\n  name: 'Error',\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    hello: t.string({\n      errors: {\n        types: [Error],\n      },\n      args: {\n        name: t.arg.string({ required: false }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.slice(0, 1) !== name.slice(0, 1).toUpperCase()) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\nThe above example will produce a GraphQL schema that looks like:\n\n```graphql\ntype Error {\n  message: String!\n}\n\ntype Query {\n  hello(name: String!): QueryHelloResult\n}\n\nunion QueryHelloResult = Error | QueryHelloSuccess\n\ntype QueryHelloSuccess {\n  data: String!\n}\n```\n\nThis field can be queried using fragments like:\n\n```graphql\nquery {\n  hello(name: \"World\") {\n    __typename\n    ... on Error {\n      message\n    }\n    ... on QueryHelloSuccess {\n      data\n    }\n  }\n}\n```\n\nThis plugin works by wrapping fields that define error options in a union type. This union consists\nof an object type for each error type defined for the field, and a Success object type that wraps\nthe returned data. If the fields resolver throws an instance of one of the defined errors, the\nerrors plugin will automatically resolve to the corresponding error object type.\n\n### Builder options\n\n- `defaultTypes`: An array of Error classes to include in every field with error handling.\n\n### Options on Fields\n\n- `types`: An array of Error classes to catch and handle as error objects in the schema. Will be\n  merged with `defaultTypes` from builder.\n- `union`: An options object for the union type. Can include any normal union type options, and\n  `name` option for setting a custom name for the union type.\n- `result`: An options object for result object type. Can include any normal object type options,\n  and `name` option for setting a custom name for the result type.\n- `dataField`: An options object for the data field on the result object. This field will be named\n  `data` by default, but can be written by passsing a custom `name` option.\n\n### Recommended Ussage\n\n1. Set up an Error interface\n2. Create a BaseError object type\n3. Include the Error interface in any custom Error types you define\n4. Include the BaseError type in the `defaultTypes` in the builder config\n\nThis pattern will allow you to consistently query your schema using a `... on Error { message }`\nfragment since all Error classes extend that interface. If your client want's to query details of\nmore specialized error types, they can just add a fragment for the errors it cares about. This\npattern should also make it easier to make future changes without unexpected breaking changes for\nyour clients.\n\nThe follow is a small example of this pattern:\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [Error],\n  },\n});\n\nconst ErrorInterface = builder.interfaceRef<Error>('Error').implement({\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.objectType(Error, {\n  name: 'BaseError',\n  isTypeOf: (obj) => obj instanceof Error,\n  interfaces: [ErrorInterface],\n});\n\nclass LengthError extends Error {\n  minLength: number;\n\n  constructor(minLength: number) {\n    super(`string length should be at least ${minLength}`);\n\n    this.minLength = minLength;\n    this.name = 'LengthError';\n  }\n}\n\nbuilder.objectType(LengthError, {\n  name: 'LengthError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof LengthError,\n  fields: (t) => ({\n    minLength: t.exposeInt('minLength'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    // Simple error handling just using base error class\n    hello: t.string({\n      errors: {},\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (!name.startsWith(name.slice(0, 1).toUpperCase())) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n    // Handling custom errors\n    helloWithMinLength: t.string({\n      errors: {\n        types: [LengthError],\n      },\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.length < 5) {\n          throw new LengthError(5);\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\n### With validation plugin\n\nTo use this in combination with the validation plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nOnce your plugins are set up, you can define types for a ZodError, the same way you would for any\nother error type. Below is a simple example of how this can be done, but the specifics of how you\nstructure your error types are left up to you.\n\n```typescript\n// Util for flattening zod errors into something easier to represent in your Schema.\nfunction flattenErrors(\n  error: ZodFormattedError<unknown>,\n  path: string[],\n): { path: string[]; message: string }[] {\n  // eslint-disable-next-line no-underscore-dangle\n  const errors = error._errors.map((message) => ({\n    path,\n    message,\n  }));\n\n  Object.keys(error).forEach((key) => {\n    if (key !== '_errors') {\n      errors.push(\n        ...flattenErrors((error as Record<string, unknown>)[key] as ZodFormattedError<unknown>, [\n          ...path,\n          key,\n        ]),\n      );\n    }\n  });\n\n  return errors;\n}\n\n// A type for the individual validation issues\nconst ZodFieldError = builder\n  .objectRef<{\n    message: string;\n    path: string[];\n  }>('ZodFieldError')\n  .implement({\n    fields: (t) => ({\n      message: t.exposeString('message'),\n      path: t.exposeStringList('path'),\n    }),\n  });\n\n// The actual error type\nbuilder.objectType(ZodError, {\n  name: 'ZodError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof ZodError,\n  fields: (t) => ({\n    fieldErrors: t.field({\n      type: [ZodFieldError],\n      resolve: (err) => flattenErrors(err.format(), []),\n    }),\n  }),\n});\n\nbuilder.queryField('fieldWIthValidation', (t) =>\n  t.boolean({\n    errors: {\n      types: [ZodError],\n    },\n    args: {\n      string: t.arg.string({\n        validate: {\n          type: 'string',\n          minLength: 3,\n        },\n      }),\n    },\n    resolve: () => true,\n  }),\n);\n```\n\nExample query:\n\n```graphql\nquery {\n  validation(string: \"a\") {\n    __typename\n    ... on QueryValidationSuccess {\n      data\n    }\n    ... on ZodError {\n      fieldErrors {\n        message\n        path\n      }\n    }\n  }\n}\n```\n\n### With the dataloader plugin\n\nTo use this in combination with the dataloader plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nIf a field with `errors` returns a `loadableObject`, or `loadableNode` the errors plugin will now\ncatch errors thrown when loading ids returned by the `resolve` function.\n\nplugin. This is because if items are nullable, the items in the list may be set to null rather that\nIf the field is a `List` field, errors that occur when resolving objects from `ids` will not be\nhandled by the errors plugin. This is because those errors are associated with each item in the list\nrather than the list field itself. In the future, the dataloader plugin may have an option to throw\nan error at the field level if any items can not be loaded, which would allow the error plugin to\nhandle these types of errors.\n\n### With the prisma plugin\n\nTo use this in combination with the prisma plugin, ensure that that errors plugin is listed BEFORE\nthe validation plugin in your plugin list. This will enable `errors` option to work work correctly\nwith any field builder method from the prisma plugin.\n\n`errors` can be configured for any field, but if there is an error pre-loading a relation the error\nwill always surfaced at the field that executed the query. Because there are cases that fall back to\nexecuting queries for relation fields, these fields may still have errors if the relation was not\npre-loaded. Detection of nested relations will continue to work if those relations use the `errors`\nplugin\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@0.0.0-preview-202172532716","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-oltrQcxsLAG19pUvuBrZUQXsw0WNIE4bZhJpQrn3UHQTBCZyTLUGL0j/7XIeyFgDjWD48nWN4dbsBYdo7ZUHJw==","shasum":"1d2a5eb0dac07a57105e492e5da3119fb5bd3c99","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-0.0.0-preview-202172532716.tgz","fileCount":34,"unpackedSize":108140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJbilCRA9TVsSAnZWagAAZNwP/0cIxG2FppbzK8eH85RI\npAwoHt9Ust4TU1qAjXb+8MC+EoH18xeZJct8Or651ekhQ/IoGdJ6aruFv1nm\nj4CGdsdZuzFe+ryqy7NU7AWzC29eS6wTljgGbVuHBEvmVEGg6q+G03sC5ryg\nREogtMf6BVjZBTfT0TuQeBlbtnoQ0xnIFjPjkoBs6uDGHV58SlVHYAldmL9b\nW18Yofh2qYgJziD9syaq7PyNk/OPzLbKeRp8inzT6BZjuPYt/Is86M2tzZ+h\nHlNOzhAxV629tz9gtyjlAjnSiZ82uzx5Tc2P05gKDB1ruriwK4RzL2rKyTub\nnpKK+9NwNeY2uYbAjw7FDiWekgql0Q8zSW9MlOvfkzakP2RlSQBejDAyNOLA\n3o+MNhUDS0tYALs8kyRa3FqRSK4PMntYAXfW55Q/X6ZFlTXceCTzdHp/Yt36\n9LMamw3AVKH3UvuD16GF/50nIT0QDF5M9v9KVPnSdnmnZW0k92JuTRqxJezV\nJHHxEJylvq9oKDvUeJRAoHgoFQDGZro/Wk8cJAIpFxCeqrm8yxfO6V4U+vio\nM/NgLFpWh9Z1Etd8sscXIs7l/2dz3cEXf27nqXjIClmbq4l/AViNINvBOdA8\nH+c2FX2axAEpIdw/waVwNtpLIEnyldFTHtQy+Jza3ArecPhCpdBrWuF8tAH5\n/7wX\r\n=GbH+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrQm44JOeH3uOrXIr4VWLpbyMd3Lw1XHE2+myICW4BDgIgVAKc4RbVBV6UieMDptguGXVbrgjuEh7sqm3xVu7hNBs="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_0.0.0-preview-202172532716_1629862053107_0.4092420920056916"},"_hasShrinkwrap":false},"0.0.0-preview-202172534216":{"name":"@giraphql/plugin-errors","version":"0.0.0-preview-202172534216","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^0.0.0-preview-202172534216","@giraphql/plugin-validation":"^0.0.0-preview-202172534216","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-0.0.0-preview-202172534216.tgz","readme":"# Errors Plugin\n\nA plugin for easily including error types in your GraphQL schema and hooking up error types to\nresolvers\n\n## Usage\n\n### Install\n\n```bash\nyarn add @giraphql/plugin-errors\n```\n\n### Setup\n\nEnsure that the target in your `tsconfig.json` is set to `es6` or higher (default is `es3`).\n\n### Example Usage\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [],\n  },\n});\n\nbuilder.objectType(Error, {\n  name: 'Error',\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    hello: t.string({\n      errors: {\n        types: [Error],\n      },\n      args: {\n        name: t.arg.string({ required: false }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.slice(0, 1) !== name.slice(0, 1).toUpperCase()) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\nThe above example will produce a GraphQL schema that looks like:\n\n```graphql\ntype Error {\n  message: String!\n}\n\ntype Query {\n  hello(name: String!): QueryHelloResult\n}\n\nunion QueryHelloResult = Error | QueryHelloSuccess\n\ntype QueryHelloSuccess {\n  data: String!\n}\n```\n\nThis field can be queried using fragments like:\n\n```graphql\nquery {\n  hello(name: \"World\") {\n    __typename\n    ... on Error {\n      message\n    }\n    ... on QueryHelloSuccess {\n      data\n    }\n  }\n}\n```\n\nThis plugin works by wrapping fields that define error options in a union type. This union consists\nof an object type for each error type defined for the field, and a Success object type that wraps\nthe returned data. If the fields resolver throws an instance of one of the defined errors, the\nerrors plugin will automatically resolve to the corresponding error object type.\n\n### Builder options\n\n- `defaultTypes`: An array of Error classes to include in every field with error handling.\n\n### Options on Fields\n\n- `types`: An array of Error classes to catch and handle as error objects in the schema. Will be\n  merged with `defaultTypes` from builder.\n- `union`: An options object for the union type. Can include any normal union type options, and\n  `name` option for setting a custom name for the union type.\n- `result`: An options object for result object type. Can include any normal object type options,\n  and `name` option for setting a custom name for the result type.\n- `dataField`: An options object for the data field on the result object. This field will be named\n  `data` by default, but can be written by passsing a custom `name` option.\n\n### Recommended Ussage\n\n1. Set up an Error interface\n2. Create a BaseError object type\n3. Include the Error interface in any custom Error types you define\n4. Include the BaseError type in the `defaultTypes` in the builder config\n\nThis pattern will allow you to consistently query your schema using a `... on Error { message }`\nfragment since all Error classes extend that interface. If your client want's to query details of\nmore specialized error types, they can just add a fragment for the errors it cares about. This\npattern should also make it easier to make future changes without unexpected breaking changes for\nyour clients.\n\nThe follow is a small example of this pattern:\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [Error],\n  },\n});\n\nconst ErrorInterface = builder.interfaceRef<Error>('Error').implement({\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.objectType(Error, {\n  name: 'BaseError',\n  isTypeOf: (obj) => obj instanceof Error,\n  interfaces: [ErrorInterface],\n});\n\nclass LengthError extends Error {\n  minLength: number;\n\n  constructor(minLength: number) {\n    super(`string length should be at least ${minLength}`);\n\n    this.minLength = minLength;\n    this.name = 'LengthError';\n  }\n}\n\nbuilder.objectType(LengthError, {\n  name: 'LengthError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof LengthError,\n  fields: (t) => ({\n    minLength: t.exposeInt('minLength'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    // Simple error handling just using base error class\n    hello: t.string({\n      errors: {},\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (!name.startsWith(name.slice(0, 1).toUpperCase())) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n    // Handling custom errors\n    helloWithMinLength: t.string({\n      errors: {\n        types: [LengthError],\n      },\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.length < 5) {\n          throw new LengthError(5);\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\n### With validation plugin\n\nTo use this in combination with the validation plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nOnce your plugins are set up, you can define types for a ZodError, the same way you would for any\nother error type. Below is a simple example of how this can be done, but the specifics of how you\nstructure your error types are left up to you.\n\n```typescript\n// Util for flattening zod errors into something easier to represent in your Schema.\nfunction flattenErrors(\n  error: ZodFormattedError<unknown>,\n  path: string[],\n): { path: string[]; message: string }[] {\n  // eslint-disable-next-line no-underscore-dangle\n  const errors = error._errors.map((message) => ({\n    path,\n    message,\n  }));\n\n  Object.keys(error).forEach((key) => {\n    if (key !== '_errors') {\n      errors.push(\n        ...flattenErrors((error as Record<string, unknown>)[key] as ZodFormattedError<unknown>, [\n          ...path,\n          key,\n        ]),\n      );\n    }\n  });\n\n  return errors;\n}\n\n// A type for the individual validation issues\nconst ZodFieldError = builder\n  .objectRef<{\n    message: string;\n    path: string[];\n  }>('ZodFieldError')\n  .implement({\n    fields: (t) => ({\n      message: t.exposeString('message'),\n      path: t.exposeStringList('path'),\n    }),\n  });\n\n// The actual error type\nbuilder.objectType(ZodError, {\n  name: 'ZodError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof ZodError,\n  fields: (t) => ({\n    fieldErrors: t.field({\n      type: [ZodFieldError],\n      resolve: (err) => flattenErrors(err.format(), []),\n    }),\n  }),\n});\n\nbuilder.queryField('fieldWIthValidation', (t) =>\n  t.boolean({\n    errors: {\n      types: [ZodError],\n    },\n    args: {\n      string: t.arg.string({\n        validate: {\n          type: 'string',\n          minLength: 3,\n        },\n      }),\n    },\n    resolve: () => true,\n  }),\n);\n```\n\nExample query:\n\n```graphql\nquery {\n  validation(string: \"a\") {\n    __typename\n    ... on QueryValidationSuccess {\n      data\n    }\n    ... on ZodError {\n      fieldErrors {\n        message\n        path\n      }\n    }\n  }\n}\n```\n\n### With the dataloader plugin\n\nTo use this in combination with the dataloader plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nIf a field with `errors` returns a `loadableObject`, or `loadableNode` the errors plugin will now\ncatch errors thrown when loading ids returned by the `resolve` function.\n\nplugin. This is because if items are nullable, the items in the list may be set to null rather that\nIf the field is a `List` field, errors that occur when resolving objects from `ids` will not be\nhandled by the errors plugin. This is because those errors are associated with each item in the list\nrather than the list field itself. In the future, the dataloader plugin may have an option to throw\nan error at the field level if any items can not be loaded, which would allow the error plugin to\nhandle these types of errors.\n\n### With the prisma plugin\n\nTo use this in combination with the prisma plugin, ensure that that errors plugin is listed BEFORE\nthe validation plugin in your plugin list. This will enable `errors` option to work work correctly\nwith any field builder method from the prisma plugin.\n\n`errors` can be configured for any field, but if there is an error pre-loading a relation the error\nwill always surfaced at the field that executed the query. Because there are cases that fall back to\nexecuting queries for relation fields, these fields may still have errors if the relation was not\npre-loaded. Detection of nested relations will continue to work if those relations use the `errors`\nplugin\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@0.0.0-preview-202172534216","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-jxBFtQWuErleF0k2w8PA3mFk6lU7PGGVc4pxoA3lhGa8p7KINGVaTtrgX9qNpEYoLSw2PUlRd140wuwmtNknZw==","shasum":"b53c6295d5c6bf42a803b24fa6922a91c550809b","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-0.0.0-preview-202172534216.tgz","fileCount":34,"unpackedSize":108140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJbwmCRA9TVsSAnZWagAAa7UP/3mKHLx4L/wirF7nD7d3\n8qvGb2/aXPL6AOxlaw4pB25qZha5GZ2aJvqsN8pTaAXWXFCcjU/y+/tcYcVX\n6UPjqnFhKQOZ5hpyphlLgpz1lO+XaCs67E5uaTftyHxBQ246OOMITWTSQvKL\ny4nKNuye+bi2nC3d58Kadoa1yrLfSTvCpCcgZGFagj2FyrYnYhohRJLO+Qy1\nEx8OQ0VB51jKb/1EEjGuKYe2lZGT7jeKB7vkH1tb0jkEIE8sJxB0cTz4UaJp\nLHMwMVEN3NOjRRjfYwTy0ivgcDtsUkUzmPZfqhcs9Moq6s032o717eKMqgrO\noihhpfkt+oATsuAI0gjnXUtpbDd0dT0NUMUHiTZtgMTkdqzdfgrGuVX8XQPu\n7Xt8jDEOKSwuyUWJas6y+nVPX2avGtc+jWKsNDX3t9HqGMyyk90TQukRz4ZY\nfhh2giHzt7WPinL9TtXJoLRfpL01s0TF7PoDCAy/2uOybWFz1z6SzPzPxFyr\nmVYh7NAmFvn7lraahI826Fwx6Pva9nhzoW54xPvHhFjv0mc4qXtzrEW8yJ4u\ndQdj9ZEl+sjU1+I7qRs75Ckke5VV6QilZIIxHtK0HFKCbNuxRPqcSXq1HkoU\nRAREiI/TwG+xXwtHXgQ0zyUe3Y+T+U1Uw6xmaBnVxXbX5BqdeHDRNC3GOuN1\nkuHJ\r\n=1qxT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxidY6zx8CojVoz4NwO3nkaLBfXT+XO3dkAaJ+MOQCuQIgdE2y88lRUrYWCdIf8zaSaJmJCPONy3AHCivq+vgXiSk="}]},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_0.0.0-preview-202172534216_1629862949812_0.22657487304120738"},"_hasShrinkwrap":false},"2.7.1":{"name":"@giraphql/plugin-errors","version":"2.7.1","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.14.1","@giraphql/plugin-validation":"^2.9.1","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.7.1.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.7.1","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-lYUv5cAAhyYTRFNgecNozj/HepgRfq3x1iGyPOCIAP3cBfJ+HlHLdkdGszIVCdljh5bzISuVE1tLY9vYfhuSAw==","shasum":"d7da239b180534bfd51a221bf4283d3c080879d8","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.7.1.tgz","fileCount":34,"unpackedSize":108057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJdVzCRA9TVsSAnZWagAAptcP/20Btq1M9dFVNhf6eGI5\n+JRf+pfmvnLsYxEuPqfQTkj/IohWMdujqqJewW9LGqraRZkocegOxkzcvsVP\n1dLQjI9WbgYNJBlYoQ/vFRI1fMASUVXaQbcBcaiIj7gnmeRzCiQBK4Cx6Esp\neYA8W8uMZpCi4WfoDO3fBmAK2WccO7UAsAbx7g/d4+/oyIYc+DUFW6YSp01h\nIEDBB6TWu2ybetP9UJr3XR3TyLpc9kOPcNqTIDplyqTlLAGCm7moR0FqEV7e\nI1dj8SyeUE8mr6DPRZIOt9GIO9ypi6Wtk0HBGvf6mrmw+jf0CVuiUM0+ILf/\nJYNIf32If1mH+60JAi5/3K3q3i9hHBL2QKJmHLxw0uz5sCou6k15zYJjaPh5\nzLsbjI7IGyDCX6Unf6tv2mWV7rqUbV1LX5ObbA5zYha2evOZSsiDEyp3hLlg\nfF8Kukd2UVrVH0FnZ6wQ/0Hf6oCZBhcLt29GAEvZZZYyBawfZnY6kOZhwXLi\nrwMyNN7pzYlhrVgr2oymNa/HUVpgwX4Py+ymQoRdj/lKInylGkv1ilm2r3l6\n72pja6iv7WrIHyEJ+EgqaGeDRhfOVfu/V8hXEcMYFULso8/Z2Mcbjq1WCmJG\nhoiwP+9s4k6wDgyPpKp8cNLqRmAhOBIMPX7dIbt8dwbAALNHF1ScntZFQZ0p\n0RsU\r\n=OpWT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG7onLtKC63WbJZ3VtucD14BF/gjppOW24e5rQm8HNUpAiA2Vv75pQ8YZNfydi1isqAuetOR3YKcMJxJGsSF8MXSKw=="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.7.1_1629869427508_0.520598494063107"},"_hasShrinkwrap":false},"2.7.2":{"name":"@giraphql/plugin-errors","version":"2.7.2","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.14.2","@giraphql/plugin-validation":"^2.9.2","apollo-server":"^2.25.2","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.7.2.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.7.2","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-X5NnVPLAm0WEiuTlMQoZJ9/EQUf/StJwgikd4pc26FbqGgWiklKek5gIBc8IPusmDdi/ZTCLGNT9aZmvUebnow==","shasum":"4df2aaa55dc79bdc998babc5112cefc7b2ae8ada","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.7.2.tgz","fileCount":34,"unpackedSize":107994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKWbWCRA9TVsSAnZWagAAWEEP/0WdGVOjWbtV5YUfq6kQ\nNiTm/RzsMyOrCn4yqRlSkgmO0N+I2XvVNYwAS0ldnJ7jXYDTRXtpVOJiYihB\n7cYaikT0P9JC7OASeV0ny5Wxc5fcMuZF97IY5f5UXXoR04xKCWsXSZweE/c7\nBvx1DIj7DYT0HN8zRbwLnFGrwak0Wnadknum/UjgyL7ibmReZohm78UiRRMi\neFVzZsxd7Hlhd3jEfZr+6ztNgbNYxuvCdnYgLjdf1MYSbJGdH7IX+lsT0DyJ\nYj8ZhyfE7tns27riN1Kwkr2hVAl3prVcFXGCwovpHkXyTC5DizW/ECQC6kGZ\nHlH1FEeBhZLNp7h+4JRXdR1O0/FzfxLHSIsyx+m4DjjcY7sBt0gvaMNTew1P\npyFBG2BHRQWHPZPdgqL3vyu5+17MgGaNczOGiRkZakf38bmRiA5+uHMdlTsn\nyLi16Klmq2/BGKVufX+x3eTfZAVSIisJtv6luNN66tOJqgUhvoL1DAbfMyOB\nGoo20IepayO9zRWdhemi4HA63zMejW/+ig7fFvGiTtEQZ2pc6KZlAZhmTYk0\nwrHcwydb3C+4hbEEf2KXZEmoHLs2FtXmA786TPxPAFvTmXIEyWgKOcTNSzVQ\nUvfVqEAPPiv0oUIUGOhltn9vg2cfqDGGr1gL5vJBSxiMnJHMINM0FeaCnGfZ\n8pLE\r\n=llVx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCymFn6e78g2cygs4fBSAnPVTCLGY9FP1lD5JKrGIdlsQIgLnTvG5n8KKPpw18QOJwMmDUgCzQGk6M9MKvNg0thTeQ="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.7.2_1630103254097_0.40441015310256123"},"_hasShrinkwrap":false},"2.8.0":{"name":"@giraphql/plugin-errors","version":"2.8.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.15.0","@giraphql/test-utils":"^0.1.0","@giraphql/plugin-validation":"^2.10.0","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.8.0.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.8.0","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-T2lOkQyCdPGHQJPpNiePff+iCcHoCNKZdvTRxWrUhEMl/yID7OGcOqZGGucxIrXYvRfsUtXneCOZygd3vx3GEg==","shasum":"c37798370195fcd8d453523eb58079e8f7e7e8ef","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.8.0.tgz","fileCount":34,"unpackedSize":104019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKzlKCRA9TVsSAnZWagAAZUgQAIqHvN4naHy5PknIVXuL\n24Qa7hxVwFEe81H8QBgSvjRnXCOuAQJXy2e7EuBXbzsN6RBGvP+6ZTZIUNXc\n8FokIJ89kWZtCSNmBUyabHOx/Me0xsPZbC6SGJKBMkTByT+Tj+fP9jcj3gJS\ndHiLx9gP1wopc5n6uROKUiTuh7a8gMSPzuZCcv6+v0s4WCJBzYYZ+9oY6sP8\nOezWuhC15pRNWMzdvRAgioaeQPreKOTsKcs++tX/rEamobYeiFWlK1czZnZN\n+bNFzjKaIvtxF3ygzHMUMfNssWhre8ADnct9CTbpFSyza4ZFhO4u0Mb1aOfl\nx0WJvuzBnNG7URNZJgG8T8tv97FU7tGJXV+ZEIVbi90jjoHmkxQg+330DtbC\nqQBq10/ZOv73kGAYTRyRbNrEl3BPk2IN/o6MN2rNqFhPEd/CsjWNSLHjk+zW\nICr8OZtwZZH66ZzoAwpZUz6b/sxkvPbAtGWw9McmifmqtG8SNKoZj0uZLMxE\nWXUGC7o3NH3I1vY1Z8qm/BvCW0FTb77PjfyAPBhrKA7kHj5WGRiwL8IyJLsi\nRFi4h4tajO/PZRYTzKRZi1+JeYpeDY2I/Arvmf7N8ajpmfi6JEkIGggjvwKe\nwEdyi//BUF8mrVaYB4xKrX+5EeXlb8cKvASzVB7+c2t29oeomvP7oSI2c+VI\nQ38U\r\n=6nt3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1JUakt4pHZ4JBr5dRS1C7gCZN16lYaIFAHeAqUDZHSgIgGLONLIy2bDZFXLxz9FalCYwAWPhIrXvzJSBhra2UVOo="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.8.0_1630222665896_0.40557827665535995"},"_hasShrinkwrap":false},"2.8.1":{"name":"@giraphql/plugin-errors","version":"2.8.1","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.15.1","@giraphql/test-utils":"^0.1.1","@giraphql/plugin-validation":"^2.10.1","graphql":">=15.5.1","graphql-tag":"^2.12.5"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.8.1.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.8.1","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-dPgKoIdg+9k+735AFsore65e8kNpUDMz2yX/r4Dkslg0lM9ztuaS66WkS8/TX2c1lus7F1+wf9rC4/hexeUlXw==","shasum":"26612d77ae172b3b61400688b1d29cbf30fd1df8","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.8.1.tgz","fileCount":34,"unpackedSize":104117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLRicCRA9TVsSAnZWagAAA+IP/A14LJoq2/unoxaWR3bo\nQjq9O3kg9G4SjgSxdC1+dbr/mP4zh/wLBOk8jgsltAS5fLr5FLfvfAJmGt6m\nhTtGVfNP3/say8xTBkOTcxKEoYJnRP/1vnK8X9vTvA3hRhx8kqs/V2d6dw4P\n3TrMAOn5TO4+GhsXdw9MIuKMVOMrSDAtFZaovm7ssTzARm6IFWDWUFpsok1Y\nMP2TG1DjhcRYVclxYjEHMw+4prA+UcfIhIgAUaNakoHRsOw1Rrs+FsJZj/BZ\nyhL3g9MQp34/fBk2ch8Bk73mdulY8czlyiylSHRHDzFqLVA9SImAbHeIhiyt\nWQ4MxLKA4hHkxAxr2WCEOXQHahrx0nF/8J2oeqx6ZXb5FBJQdNorom1zCUuZ\nYO9nKnS6Sdm5p6ljxRTe9HlAutH6xMo3ijnZuwalYe7E1QQMN19xRQWq3TSr\nbl5a958boBC1zGRFhc6oG+PNUDLzoTN+DuGdnjjCtrUk1OeVH+EsGhSRyCMX\naxWmJDFouM5fGWhU6KAfm9J1/MJZGuZb9n9K0IdLe0VIXBo7qDB2180hzdqO\nXWbwvJyBDXn8XMJDG3gCmK7tqLEwb/LyHFHM8e296wT9vwPo8T6kPvrqF9Oy\ny+TEwLhLIDDOCrjp24+5zy3N1Vtj5XCobpMtbfDZDvZt4hSxTQdQnwxrXxaV\naGlK\r\n=PUFl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHxIKCuC3BG67WKRWhZs4lWmtemaXiTuis4XxVschMx6AiB16N1fs8Bb+t2LjhZ+Fnkp/mssIrSe9ACrZBY4V520Bg=="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.8.1_1630345372513_0.4694330747303488"},"_hasShrinkwrap":false},"2.8.2":{"name":"@giraphql/plugin-errors","version":"2.8.2","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.15.2","@giraphql/plugin-validation":"^2.10.2","@giraphql/test-utils":"^0.1.2","graphql":"15.6.0","graphql-tag":"^2.12.5","zod":"^3.8.2"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.8.2.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.8.2","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-QkILDYVfsrOxNZNfIPHxF8KWEQOiiAqXDhg7Id+za2uchJjdAyL1fppPJjZtzoJ86DYXTEHej5rM/mtxSNedBA==","shasum":"383fe757ed68e47a81be9e83e2ecd9de46254221","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.8.2.tgz","fileCount":34,"unpackedSize":103626,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDASQQEC7pRuav4nMAFlnX+3o6yw+0YnBhslj+eoDSyKwIhAI40cRj/LxC7yYm1EhN8Tak9hUR7hbH2Xt6MbxvU1Qil"}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.8.2_1632278617931_0.7024144652711304"},"_hasShrinkwrap":false},"2.9.0":{"name":"@giraphql/plugin-errors","version":"2.9.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.15.2","@giraphql/plugin-validation":"^2.10.2","@giraphql/test-utils":"^0.1.2","graphql":"15.6.0","graphql-tag":"^2.12.5","zod":"^3.8.2"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.9.0.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.9.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-yc1KmHB8UoOKg34OzfIwr30ju7wki/LCtbpAa5BFRh/KuSJgj3z8823J1aVz93cgubhkwSV3Qe/m+ddyJkJcpQ==","shasum":"662afc1a5320cec44c56017c65994a53a0aaee9f","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.9.0.tgz","fileCount":34,"unpackedSize":107979,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC67/fxqQhiiM8x9pr3a2pPB8c7jy6m1eAaDGaVZlWNcAiBF15kwUO7vivfffd+yDrNzWM4s5mlRxouISPRFRrkbsw=="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.9.0_1632368391367_0.45390103644664825"},"_hasShrinkwrap":false},"2.10.0":{"name":"@giraphql/plugin-errors","version":"2.10.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.16.0","@giraphql/plugin-validation":"^2.12.0","@giraphql/test-utils":"^0.2.0","graphql":"15.6.0","graphql-tag":"^2.12.5","zod":"^3.8.2"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.10.0.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.10.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-kfwmgi6ld2PeJNcyyxoHJ6e97PjcHvoXbJEnpG6X4kLCCl4XE8NUOIc3o2DdoxXRm3deMpr/nc2+oGXHOhnlzA==","shasum":"86d620f6b4cd7f000c296b4e6fc664282e3cae5c","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.10.0.tgz","fileCount":34,"unpackedSize":110078,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4nhfaf2LCrBsVocECMkrvOlyHM6MF1RPpp9nyYATy9gIgY90q2l3Ior5cI1MAWQGvTP/Ku5XpLPjIhL8hFTBtLCc="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.10.0_1632971278072_0.3324512527783996"},"_hasShrinkwrap":false},"2.11.0":{"name":"@giraphql/plugin-errors","version":"2.11.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.17.0","@giraphql/plugin-validation":"^2.13.0","@giraphql/test-utils":"^0.3.0","graphql":"16.0.1","graphql-tag":"^2.12.5","zod":"^3.11.6"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.11.0.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.11.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-EzZVJiMf296A/4ny3NBCeoEben2DcZDRUCZz9fOBc/ob/dJtOG9VZ9HV1QiBn0XBoTblqCldNhlsjkrr+ORRSA==","shasum":"bee610910848630ac8cab9094d6845b2abc85e79","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.11.0.tgz","fileCount":34,"unpackedSize":110441,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpH4m1L6EhFkzhgCoWN+6dyMFw9SbiHMvgRC0qZQaCWwIgadNTSmIig8lTmrjnL93OxodGMCpQKUT6zFe+HzW6lyk="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.11.0_1635985511537_0.24886743563357605"},"_hasShrinkwrap":false},"2.12.0":{"name":"@giraphql/plugin-errors","version":"2.12.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.18.0","@giraphql/plugin-validation":"^2.14.0","@giraphql/test-utils":"^0.4.0","graphql":"16.0.1","graphql-tag":"^2.12.6","zod":"^3.11.6"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.12.0.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.12.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-KJSq8bjF8ypSLa5I/B8jRl+4KQJAd6JSVep3ZvUYI6P7Zu/dazfBFk1bhQwWZMPAjuhO4ke10LTX6/6kAnlxSg==","shasum":"b4fedfd1783d92c4c879d552f5f4646b80d965e2","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.12.0.tgz","fileCount":34,"unpackedSize":110504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlEjGCRA9TVsSAnZWagAAXWwQAJ7wij9TOd9pJ26CPv/c\nzRAT7X7VahSG6oqijKehPySlvascyfu6uy5zUdoNIM+3j1jjHcVgnlSv94Co\nc7dA522xGHzrix/N73qZHi5/apSqSjfJ+nxDOOVYzqRdPsj82/OcgrFIyIqr\n5M5QIm9Q0jHAOc61eHXaXZ4EJj1n3uVGQJeZ5E+qtw9NaEcA0cs6W0Rosfc5\nhLhvV1m7Ma2CX09b3JS/EjhyPu1HuOVR+XHs9QweLr+CWM1TTcv2k/sSxI36\n1+8vN3FM7u1HWwuIkv1VwNuQQ615UyY5y5Mg/rsMF1WGrSDYW77cXP4SFB8W\nx7ffL45MrLOdEqQ/x8WJdL28hJ6SA/HQ9uTVFV/U8FQfjj+Q8G/LcPR9oTm5\nLGeUpjlAe5pVpOeltOAdiZDsYW4T5DqdF+gtxmvsOI8RDJsx9Gs5mgqk88yP\nhEPksn6VNyR+1LfyfSt/FGSXuEbkN3kKrvHB5+HYlFjmxCAM1Ern9B8Hae3g\nRaM3dz/ZZ12sGbvo6edElobjn+0wHvuG0XNbyeW96qX5nCmcSD1TAQJllFsa\n/ocXj0MnXnl5J7fwUge6v0KCMie1a4kCoB6cO7fQmhpDS2XpLGLE6vwwWn3F\n5qvEEa1HS1Jv2hrFlaMynHK9i+qp29RkTNb5+Yp1eArqTAYUn8t1qenOmjad\n0bg/\r\n=hXOB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEpUnYSMqNulPZr9bUran5G9zXzQeOnv5CaAMfyBKZWsAiBf2v7wUkoSa5bujnBouU+05i5/O4zZp137XB7dgy9sHQ=="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.12.0_1637107910063_0.08380399173850983"},"_hasShrinkwrap":false},"2.12.1":{"name":"@giraphql/plugin-errors","version":"2.12.1","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","types":"./lib/index.d.ts","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.18.1","@giraphql/plugin-validation":"^2.14.1","@giraphql/test-utils":"^0.4.1","graphql":"16.0.1","graphql-tag":"^2.12.6","zod":"^3.11.6"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.12.1.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.12.1","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-gC5VoWqO9BucrDTXxSEGeVCK7Guwvsu/7viDm4eqEW5fTL71cBrt0vJ6dKRFHBDZdBo0PIXzzjKHyrnKK7HddQ==","shasum":"f16b30b1365b87fd6d5bb53b84e414b90c216aa1","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.12.1.tgz","fileCount":34,"unpackedSize":110609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlHFpCRA9TVsSAnZWagAAnlkP/RbqhkZ4SjzunC62aD0h\nah7LuURL4ehi1O2X820r4utBjSU7unVa6+GUNnQQxlA+Yti4+e2bOo3eenWH\nka/wBxr2nnzATZzkfq5is5YxfACPKA5rbOB+QPg1+LJxaIsjY/ELdpMEeFC5\nAcH/9PmEFU8Z5pZj8DcOG34N99JpZSPgrA71lkQj6ihxxXNQGsKWkWTEJSSP\nVRpml7BdLSuazN0qp4HfSCXOkoS212dcxqmimCamyCYSxSmPt7kG0ds9Bsb6\nENkAUw+/PKTMxDdBr8kI7jWTEErjoT+plz/ayDKSc7PlHP6tD9bIi1005MbF\nyA90JOL5YEJnZLmLXQZGkqLZyweiyYX1y1koL6Xl3EjYf90hr1KePnCg7Q01\nLWEkIT/rXpwG4jLzlVUGbFauRTumX8tSOEGKZkr/up/uDIwGXS0WljbUJz/5\nBQpwtkAqiqVhpKYRNeS3QLv1SNqkZ/PEshk8QFocGHPKGsBRZc6WtqUlJRAa\nwdaB/JAI+77NTZilY8qpG6gwzN4AZ5nhdHbjBkcQLhYuUl0RuQRg8lxRWiYC\nAzW4a1KpvOo4oBBcNh88o13cXvjuPvTphT5GfUCqCysCRSL2COiPhG4eiCmy\nNYvsu7h4DZwmPZW/vuwpl4Z9cC8GqnEF9jIK2TE/PlFGPOeEOZ1SGpo56qP7\n+s3/\r\n=9wBA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHIOvdUNJpcsxbN3YayNSw3vcmk5/iqWLQTq1xvdimB0AiAfNmymMF7/KoVuIEmwfvUM1ltVxBcIuUn523KlD+JsmA=="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.12.1_1637118313327_0.5822458660625116"},"_hasShrinkwrap":false},"2.12.2":{"name":"@giraphql/plugin-errors","version":"2.12.2","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","types":"./lib/index.d.ts","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.19.1","@giraphql/plugin-validation":"^2.15.1","@giraphql/test-utils":"^0.5.1","graphql":"16.0.1","graphql-tag":"^2.12.6","zod":"^3.11.6"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.12.2.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.12.2","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-CkOjnWyNMHo2DSvW81pjQMf0OHXzaCxD654U9hOELwo4FoVA5nLCD2kEEXXUWkxp/gk8XKitP3ZKr/EtE3JVuw==","shasum":"49d0a30529e546d633e9fc2d27a3f000e21d03f7","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.12.2.tgz","fileCount":34,"unpackedSize":110904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpb4pCRA9TVsSAnZWagAAGrsQAIH7ZD2lwYROjqrurfuz\nQTYLF8bbVcgYJIijk408xUwTyyCTChTe0T49yxqzmHsfEy07QFqn73Zqtz7C\nuHJ09eTpEe22AEM+VDPetXP+7IpwTKc4zO43y8n/ZU/YQgwstQ5c7+jg+iuh\n03ltlHD4QM8nDKW4sb84pFSmoupTPWyF2SdeQzh74wR/7bEznl5DnBd71iEB\n8Q4orUBB+uoSzEnCNN+9MtyPRYarRbdSJvhJfxfeeSGuySfNTm+YZ0EZFqhr\nmkXbPnwVj/d3xuTjs3anj3oAsIjvRovEqjAcZ88Qu4huOxofvEzr6hDsCDbQ\nkl0lTZuEw7H6y6RhxIBYN/ruDGSoOGp2z+xCX3AzhFt4Y7XOkfw2cx7WYYhN\nVAIxpGNCC1DVpj5G7fBMS/t/LNxzuVwiwUC0/8NrsLGZGY9vCFn7PCkYY+PL\nDz7uAyY4j09arqCWbuS35pbIg+kXyWIwOSGEauM6MbvtzzJQHOQ9sLzP3uUq\n3QtOlFQmIgDXcu7gqRrg52fBdtiA91AEQ3LwjIXDA2tMbPQWPTVb1rpTcHuT\n0RkTHmZhLSBfbNwZuCsW2nb0ElrwkCH7CX9qlnPOHs58Y9RcmsSYRA62Eta5\nbllYj+Yh9V9tKHWge392x9tlyU4bVB0QtMkiBZggJQixavebuyyrARgnmCmt\n1a+m\r\n=q+6y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQT+jGHLMLJdthnz7zm8kV2kG/85hmMeUFh0e5fdDk9QIhAIjtId1h91+PasCAQgcO7XKwSeHY5v5g8xtd2MqXi1tM"}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.12.2_1638252073774_0.9602003804996211"},"_hasShrinkwrap":false},"2.12.3":{"name":"@giraphql/plugin-errors","version":"2.12.3","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","types":"./lib/index.d.ts","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.19.1","@giraphql/plugin-validation":"^2.15.2","@giraphql/test-utils":"^0.5.1","graphql":"16.0.1","graphql-tag":"^2.12.6","zod":"^3.11.6"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.12.3.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.12.3","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-FNwvFenS5QrLclAu2cqQkjcYacG8comBeHkhGWRQxga4/AjuCap4T+P/gGp43F+kQu60JFPBNDyDCIXEtr9MgQ==","shasum":"4b043bf095a2e51d73c2c94b381eed7939f70bbf","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.12.3.tgz","fileCount":34,"unpackedSize":111368,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJht+ySCRA9TVsSAnZWagAAJTsP+QDfgfZ2EBUUYbZ3bK3a\n2eANPugpZeTCR7sHKuOc36g3BL/GebjSgH4Kr2SujRK+4KkxDE4FFNWRoYk0\nHRKnb+wQs3V2l3p3tlBkQbIvqk+lQHvX/pKTOrNOtPdbFc5m0hFeHRhqnn1b\nwP7FhDp0bDBh7DDpdTsgzeRz5ApZd06DUuBcSEdNENPZtqRvJ+HZYt3YdU3T\n3ZcjChlDgbkxlzC55i3RhkzUKsjxwNcGFm049KhAsej0+JOc2mswWAUGUoZS\nAB4slnStN9KHR5gui8ozEFvJcXrxp5iOKMcfC0rMfN7blREiyX1D9P2Wi7Jp\nkLy2CvrrvrrZr+/SWucPAtO2yAwf05l2UWalMJBbHrTp5BwcJFY/ojS7iDip\nrvqXSrDcL4Kqb+XAkro6xs0046z9pELI5AN+ya0SbLOgNn3WMjNslGqaph6b\nvhcft7hHmMP4Q+f5mCLiOLt8bZoU8AS15ja/0jRBLVAn3kby62p635kfkKCj\n87vvoPUFsJ+maGW0VF0kKr3wBc5ZGkQfZ8jHtqYEn/Fj9nYsSl0fjq51xPPa\nRFE/6yQSlrE4EE1BMFyRR8oMwBO8kxoICTeIOr/VkRtosLoR16Q7RCdeQTIH\n5joouuuSWd4npnrf/9hl9wc4D2nU2bpFXelpnISg4nz7jMbXiF5pqAfKtjep\nuqx3\r\n=GmqA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFClHujznM4T76/IBcBZSZnf0fc3C1+lrMSxjogA1ZGCAiAby6DHpQujicMstyzPbw27HdrstgmiGnnm81mX/X7ppw=="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.12.3_1639443602376_0.6233771343950683"},"_hasShrinkwrap":false},"2.13.0":{"name":"@giraphql/plugin-errors","version":"2.13.0","description":"A GiraphQL plugin for adding typed errors into your schema","main":"./lib/index.js","types":"./lib/index.d.ts","module":"./esm/index.js","exports":{"import":"./esm/index.js","require":"./lib/index.js"},"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"license":"ISC","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"publishConfig":{"access":"public"},"peerDependencies":{"graphql":">=15.1.0"},"devDependencies":{"@giraphql/core":"^2.22.0","@giraphql/plugin-validation":"^2.16.0","@giraphql/test-utils":"^0.6.0","graphql":"16.1.0","graphql-tag":"^2.12.6","zod":"^3.11.6"},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"type":"tsc --noEmit && tsc --project tests/tsconfig.json","build":"pnpm build:cjs && pnpm build:esm","build:cjs":"tsc --module commonjs --outDir lib","build:esm":"tsc --module es2020 --outDir esm && pnpm esm:extensions","esm:extensions":"ts-node --compiler-options \"{\\\"module\\\":\\\"commonjs\\\"}\" ../../.config/esm-transformer.ts","test":"pnpm jest"},"_resolved":"","_integrity":"","_from":"file:giraphql-plugin-errors-2.13.0.tgz","bugs":{"url":"https://github.com/hayes/giraphql/issues"},"homepage":"https://github.com/hayes/giraphql#readme","_id":"@giraphql/plugin-errors@2.13.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","_npmUser":{"name":"hayes","email":"michael@hayes.io"},"dist":{"integrity":"sha512-2x9nE8KcWJDSsSOKM6Vc/xE0C15ww5i7NeD2exTAe+1DY95X+diWVwqVOm6l5JrzyzCFNRa9Z8Pxy4KprNRY4w==","shasum":"5a5670247df00539ce4bc272c2167ec20a947d75","tarball":"https://registry.npmjs.org/@giraphql/plugin-errors/-/plugin-errors-2.13.0.tgz","fileCount":37,"unpackedSize":115008,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuX7KCRA9TVsSAnZWagAAzb4QAKHd/uPlD/LAkTJDEHKP\nBGuquJ/Hjzdlf0baagAhFo5fbT6ifU3gw3oVqaCIY1rW05qAlqsJV41uMzhw\nMy8YhsLrZ++x0yVl6RGDePQY1qWn3vHU6SfEcTpiz4amiaOLqUmPvTTvAxah\nKbZt8HpraOws/r48p8yWvE6BqwUKotfGxfEqucYOjpnPjuxIe6633F96R4Xe\n18ojr4qiMzA9HwWP/kqLgHvveXf6OTDd9Lna/PFwaZKpH3gFWKd+IJgwg4lS\n1HFmKqS5RCtItD2Fyswf9Dr+07sMWBEAF6HMte9eFrbg7WDI9RcxiJuTzxOI\nsUyCp4cb02DUi9SRqPuLD4PVFpwk+iLwNj4v5AfUTtuZ+yGxr/r3wyIXzw6j\nKgypL1588/rzBCFcPXKa5MIAqvk4Dz/CeuzPOwgmhvYfTCp/E5lDz0Wyzly0\nzc0I19/kthapubTlWEoEPDTEToXCHY0eGRW4DIirfql38/U7UF1dpKCzL8MY\nXGjvu+EHfZ3Qzfgr8R7/MO1HINwwgfsbF8U0DWUjEdRaIwYSeFzzX8n1KEDH\n/vsM4I21x8omUg+sU3FlT6CIvJaTdGLpJDp3JAV3pJS0+roC/aPCpAsfrbJw\naGE3PcUQA2NzYYFgOa0Aj0UFGTH/d/DvNNCcV7v18CpQMFmHduDlFanMes4y\nqm+c\r\n=ITU3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA83EVh/59gkoVclsBx9116zznIHMyqN869AOAwrEIXkAiEA3MIrGHWuvDDvPfb/7oNYi26ZSVxDyiS46f3BvUwTe+M="}]},"directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-errors_2.13.0_1639546570008_0.8510559128167723"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-28T01:13:00.944Z","2.1.0-alpha.0":"2021-06-28T01:13:01.754Z","modified":"2022-04-05T14:20:09.136Z","2.1.0-alpha.1":"2021-06-28T18:14:11.516Z","2.1.0":"2021-06-28T18:28:36.288Z","2.1.1":"2021-06-30T20:05:25.375Z","2.1.2":"2021-07-02T20:08:55.324Z","2.2.0-alpha.0":"2021-07-04T03:32:28.388Z","2.2.0":"2021-07-04T04:18:22.982Z","2.2.1":"2021-07-10T03:43:48.755Z","2.2.2-alpha.0":"2021-07-17T03:50:49.835Z","2.2.2":"2021-07-23T18:41:56.251Z","2.3.0":"2021-07-30T23:28:55.378Z","2.3.1-alpha.0":"2021-08-02T05:07:03.962Z","2.3.1":"2021-08-03T04:04:05.416Z","2.4.0":"2021-08-05T07:15:47.361Z","2.4.1":"2021-08-05T07:22:45.643Z","0.0.0-preview-202177065":"2021-08-07T00:07:02.341Z","0.0.0-preview-20217701452":"2021-08-07T00:15:06.329Z","2.4.2":"2021-08-07T00:15:30.178Z","0.0.0-preview-20217752147":"2021-08-07T05:22:01.203Z","0.0.0-preview-20217753333":"2021-08-07T05:33:48.042Z","0.0.0-preview-202178182932":"2021-08-08T18:29:49.087Z","0.0.0-preview-202178184810":"2021-08-08T18:48:24.499Z","0.0.0-preview-202178194614":"2021-08-08T19:46:28.942Z","2.5.0":"2021-08-08T19:57:19.586Z","0.0.0-preview-202179204139":"2021-08-09T20:41:55.505Z","2.6.0":"2021-08-12T23:15:14.815Z","2.7.0":"2021-08-13T01:51:49.477Z","0.0.0-preview-2021724203738":"2021-08-24T20:37:54.596Z","0.0.0-preview-202172532716":"2021-08-25T03:27:33.279Z","0.0.0-preview-202172534216":"2021-08-25T03:42:30.244Z","2.7.1":"2021-08-25T05:30:27.647Z","2.7.2":"2021-08-27T22:27:34.233Z","2.8.0":"2021-08-29T07:37:46.083Z","2.8.1":"2021-08-30T17:42:52.701Z","2.8.2":"2021-09-22T02:43:38.079Z","2.9.0":"2021-09-23T03:39:51.552Z","2.10.0":"2021-09-30T03:07:58.302Z","2.11.0":"2021-11-04T00:25:11.735Z","2.12.0":"2021-11-17T00:11:50.435Z","2.12.1":"2021-11-17T03:05:13.515Z","2.12.2":"2021-11-30T06:01:13.965Z","2.12.3":"2021-12-14T01:00:02.733Z","2.13.0":"2021-12-15T05:36:10.376Z"},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"description":"A GiraphQL plugin for adding typed errors into your schema","homepage":"https://github.com/hayes/giraphql#readme","keywords":["giraphql","graphql","schema","typescript","error","errors","plugin"],"repository":{"type":"git","url":"git+https://github.com/hayes/giraphql.git"},"author":{"name":"Michael Hayes"},"bugs":{"url":"https://github.com/hayes/giraphql/issues"},"license":"ISC","readme":"# Errors Plugin\n\nA plugin for easily including error types in your GraphQL schema and hooking up error types to\nresolvers\n\n## Usage\n\n### Install\n\n```bash\nyarn add @giraphql/plugin-errors\n```\n\n### Setup\n\nEnsure that the target in your `tsconfig.json` is set to `es6` or higher (default is `es3`).\n\n### Example Usage\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [],\n  },\n});\n\nbuilder.objectType(Error, {\n  name: 'Error',\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    hello: t.string({\n      errors: {\n        types: [Error],\n      },\n      args: {\n        name: t.arg.string({ required: false }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.slice(0, 1) !== name.slice(0, 1).toUpperCase()) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\nThe above example will produce a GraphQL schema that looks like:\n\n```graphql\ntype Error {\n  message: String!\n}\n\ntype Query {\n  hello(name: String!): QueryHelloResult\n}\n\nunion QueryHelloResult = Error | QueryHelloSuccess\n\ntype QueryHelloSuccess {\n  data: String!\n}\n```\n\nThis field can be queried using fragments like:\n\n```graphql\nquery {\n  hello(name: \"World\") {\n    __typename\n    ... on Error {\n      message\n    }\n    ... on QueryHelloSuccess {\n      data\n    }\n  }\n}\n```\n\nThis plugin works by wrapping fields that define error options in a union type. This union consists\nof an object type for each error type defined for the field, and a Success object type that wraps\nthe returned data. If the fields resolver throws an instance of one of the defined errors, the\nerrors plugin will automatically resolve to the corresponding error object type.\n\n### Builder options\n\n- `defaultTypes`: An array of Error classes to include in every field with error handling.\n- `directResult`: Sets the default for `directResult` option on fields (only affects non-list\n  fields)\n\n### Options on Fields\n\n- `types`: An array of Error classes to catch and handle as error objects in the schema. Will be\n  merged with `defaultTypes` from builder.\n- `union`: An options object for the union type. Can include any normal union type options, and\n  `name` option for setting a custom name for the union type.\n- `result`: An options object for result object type. Can include any normal object type options,\n  and `name` option for setting a custom name for the result type.\n- `dataField`: An options object for the data field on the result object. This field will be named\n  `data` by default, but can be written by passsing a custom `name` option.\n- `directResult`: Boolean, can only be set to true for non-list fields. This will directly include\n  the fields type in the union rather than creating an intermediate Result object type. This will\n  throw at build time if the type is not an object type.\n\n### Recommended Usage\n\n1. Set up an Error interface\n2. Create a BaseError object type\n3. Include the Error interface in any custom Error types you define\n4. Include the BaseError type in the `defaultTypes` in the builder config\n\nThis pattern will allow you to consistently query your schema using a `... on Error { message }`\nfragment since all Error classes extend that interface. If your client want's to query details of\nmore specialized error types, they can just add a fragment for the errors it cares about. This\npattern should also make it easier to make future changes without unexpected breaking changes for\nyour clients.\n\nThe follow is a small example of this pattern:\n\n```typescript\nimport ErrorsPlugin from '@giraphql/plugin-errors';\nconst builder = new SchemaBuilder({\n  plugins: [ErrorsPlugin],\n  errorOptions: {\n    defaultTypes: [Error],\n  },\n});\n\nconst ErrorInterface = builder.interfaceRef<Error>('Error').implement({\n  fields: (t) => ({\n    message: t.exposeString('message'),\n  }),\n});\n\nbuilder.objectType(Error, {\n  name: 'BaseError',\n  isTypeOf: (obj) => obj instanceof Error,\n  interfaces: [ErrorInterface],\n});\n\nclass LengthError extends Error {\n  minLength: number;\n\n  constructor(minLength: number) {\n    super(`string length should be at least ${minLength}`);\n\n    this.minLength = minLength;\n    this.name = 'LengthError';\n  }\n}\n\nbuilder.objectType(LengthError, {\n  name: 'LengthError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof LengthError,\n  fields: (t) => ({\n    minLength: t.exposeInt('minLength'),\n  }),\n});\n\nbuilder.queryType({\n  fields: (t) => ({\n    // Simple error handling just using base error class\n    hello: t.string({\n      errors: {},\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (!name.startsWith(name.slice(0, 1).toUpperCase())) {\n          throw new Error('name must be capitalized');\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n    // Handling custom errors\n    helloWithMinLength: t.string({\n      errors: {\n        types: [LengthError],\n      },\n      args: {\n        name: t.arg.string({ required: true }),\n      },\n      resolve: (parent, { name }) => {\n        if (name.length < 5) {\n          throw new LengthError(5);\n        }\n\n        return `hello, ${name || 'World'}`;\n      },\n    }),\n  }),\n});\n```\n\n### With validation plugin\n\nTo use this in combination with the validation plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nOnce your plugins are set up, you can define types for a ZodError, the same way you would for any\nother error type. Below is a simple example of how this can be done, but the specifics of how you\nstructure your error types are left up to you.\n\n```typescript\n// Util for flattening zod errors into something easier to represent in your Schema.\nfunction flattenErrors(\n  error: ZodFormattedError<unknown>,\n  path: string[],\n): { path: string[]; message: string }[] {\n  // eslint-disable-next-line no-underscore-dangle\n  const errors = error._errors.map((message) => ({\n    path,\n    message,\n  }));\n\n  Object.keys(error).forEach((key) => {\n    if (key !== '_errors') {\n      errors.push(\n        ...flattenErrors((error as Record<string, unknown>)[key] as ZodFormattedError<unknown>, [\n          ...path,\n          key,\n        ]),\n      );\n    }\n  });\n\n  return errors;\n}\n\n// A type for the individual validation issues\nconst ZodFieldError = builder\n  .objectRef<{\n    message: string;\n    path: string[];\n  }>('ZodFieldError')\n  .implement({\n    fields: (t) => ({\n      message: t.exposeString('message'),\n      path: t.exposeStringList('path'),\n    }),\n  });\n\n// The actual error type\nbuilder.objectType(ZodError, {\n  name: 'ZodError',\n  interfaces: [ErrorInterface],\n  isTypeOf: (obj) => obj instanceof ZodError,\n  fields: (t) => ({\n    fieldErrors: t.field({\n      type: [ZodFieldError],\n      resolve: (err) => flattenErrors(err.format(), []),\n    }),\n  }),\n});\n\nbuilder.queryField('fieldWIthValidation', (t) =>\n  t.boolean({\n    errors: {\n      types: [ZodError],\n    },\n    args: {\n      string: t.arg.string({\n        validate: {\n          type: 'string',\n          minLength: 3,\n        },\n      }),\n    },\n    resolve: () => true,\n  }),\n);\n```\n\nExample query:\n\n```graphql\nquery {\n  validation(string: \"a\") {\n    __typename\n    ... on QueryValidationSuccess {\n      data\n    }\n    ... on ZodError {\n      fieldErrors {\n        message\n        path\n      }\n    }\n  }\n}\n```\n\n### With the dataloader plugin\n\nTo use this in combination with the dataloader plugin, ensure that that errors plugin is listed\nBEFORE the validation plugin in your plugin list.\n\nIf a field with `errors` returns a `loadableObject`, or `loadableNode` the errors plugin will now\ncatch errors thrown when loading ids returned by the `resolve` function.\n\nplugin. This is because if items are nullable, the items in the list may be set to null rather that\nIf the field is a `List` field, errors that occur when resolving objects from `ids` will not be\nhandled by the errors plugin. This is because those errors are associated with each item in the list\nrather than the list field itself. In the future, the dataloader plugin may have an option to throw\nan error at the field level if any items can not be loaded, which would allow the error plugin to\nhandle these types of errors.\n\n### With the prisma plugin\n\nTo use this in combination with the prisma plugin, ensure that that errors plugin is listed BEFORE\nthe validation plugin in your plugin list. This will enable `errors` option to work work correctly\nwith any field builder method from the prisma plugin.\n\n`errors` can be configured for any field, but if there is an error pre-loading a relation the error\nwill always surfaced at the field that executed the query. Because there are cases that fall back to\nexecuting queries for relation fields, these fields may still have errors if the relation was not\npre-loaded. Detection of nested relations will continue to work if those relations use the `errors`\nplugin\n","readmeFilename":"README.md"}