{"_id":"joi2gql","_rev":"5-1ea4ba0f61f4ebb46623e7593284e5d2","name":"joi2gql","description":"Plugin","dist-tags":{"latest":"1.3.1"},"versions":{"1.1.3":{"name":"joi2gql","version":"1.1.3","private":false,"description":"Plugin","homepage":"https://github.com/xogroup/joi2gql#readme","main":"src/implementation.js","bugs":{"url":"https://github.com/xogroup/joi2gql/issues"},"repository":{"type":"git","url":"git+https://github.com/xogroup/joi2gql.git"},"keywords":["plugin","joi2gql","graphql","joi","schema"],"author":{"name":"Samuel Joli"},"license":"ISC","devDependencies":{"chai":"4.x.x","eslint":"3.x.x","eslint-plugin-xogroup":"1.x.x","graphql":"0.x.x","hoek":"4.x.x","joi":"10.x.x","lab":"14.x.x"},"peerDependencies":{"graphql":"0.x.x"},"dependencies":{"hoek":"4.2.0"},"scripts":{"test":"lab -t 100 -L -a chai","test-debug":"lab -a code","test-cov-html":"lab -r html -o coverage.html -a chai","lint":"eslint --fix src/ test/"},"gitHead":"146830145b58aab9aae982e796f44bf0ccb2fd37","_id":"joi2gql@1.1.3","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"xogrp","email":"xo-npmjs.group@xogrp.com"},"dist":{"integrity":"sha512-WpPwLiugJsQJrBzBOQ+jKFpcz5dqWi6Nb377TCyBrOvkT5TAKFPCfnybMUt5GrMObMu7Sy6TSgrjRqllt2R0dg==","shasum":"1e9d7edb2b41026bad58c13ecfb3484707638138","tarball":"https://registry.npmjs.org/joi2gql/-/joi2gql-1.1.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqSoPDlC5T09gM9Z8gpO6DyzbFWP613lyGOqT1sfu7lQIhAMH+e7QdXoPsJjD1ftTz0JEYmEQnFIq4IJEHksgxD8lW"}]},"maintainers":[{"name":"xogrp","email":"xo-npmjs.group@xogrp.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/joi2gql-1.1.3.tgz_1505942131290_0.34903614432550967"}},"1.2.0":{"name":"joi2gql","version":"1.2.0","private":false,"description":"Plugin","homepage":"https://github.com/xogroup/joi2gql#readme","main":"src/implementation.js","bugs":{"url":"https://github.com/xogroup/joi2gql/issues"},"repository":{"type":"git","url":"git+https://github.com/xogroup/joi2gql.git"},"keywords":["plugin","joi2gql","graphql","joi","schema"],"author":{"name":"Samuel Joli"},"license":"ISC","devDependencies":{"chai":"4.x.x","eslint":"3.x.x","eslint-plugin-xogroup":"1.x.x","graphql":"0.x.x","hoek":"4.x.x","joi":"10.x.x","lab":"14.x.x"},"peerDependencies":{"graphql":"0.x.x"},"dependencies":{"hoek":"4.2.0"},"scripts":{"test":"lab -t 100 -L -a chai","test-debug":"lab -a code","test-cov-html":"lab -r html -o coverage.html -a chai","lint":"eslint --fix src/ test/"},"gitHead":"1d11e0d9e274d06798247536fc7f9795130723e2","_id":"joi2gql@1.2.0","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"xogrp","email":"xo-npmjs.group@xogrp.com"},"dist":{"integrity":"sha512-JtxxwmucnR9TF2usvQXYlnZ/B1UZk/UU/8GyaeS3so+U678Zuf9OkXuusijOfWsMlxTShcIPdGugQJPyjn1nPg==","shasum":"21af51765bbdf43466e53ad11bf108aa819f081e","tarball":"https://registry.npmjs.org/joi2gql/-/joi2gql-1.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCb1xQazt2SAJj+nNZNsYEwNq6EKxa5miwDWniqKfzRMAIgMo5EQ95JOluc0fWqTKmNKN4O5Sq2/pSA4FUf7ibwCJc="}]},"maintainers":[{"name":"samueljoli","email":"samuel.joli.ftn@gmail.com"},{"name":"xogrp","email":"xo-npmjs.group@xogrp.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/joi2gql-1.2.0.tgz_1506219018074_0.18803632399067283"}},"1.3.0":{"name":"joi2gql","version":"1.3.0","private":false,"description":"Plugin","homepage":"https://github.com/xogroup/joi2gql#readme","main":"src/implementation.js","bugs":{"url":"https://github.com/xogroup/joi2gql/issues"},"repository":{"type":"git","url":"git+https://github.com/xogroup/joi2gql.git"},"keywords":["plugin","joi2gql","graphql","joi","schema"],"author":{"name":"Samuel Joli"},"license":"ISC","devDependencies":{"chai":"4.x.x","eslint":"3.x.x","eslint-plugin-xogroup":"1.x.x","graphql":"0.x.x","hoek":"4.x.x","joi":"10.x.x","lab":"14.x.x"},"peerDependencies":{"graphql":"0.x.x"},"dependencies":{"hoek":"4.2.0"},"scripts":{"test":"lab -t 100 -L -a chai","test-debug":"lab -a code","test-cov-html":"lab -r html -o coverage.html -a chai","lint":"eslint --fix src/ test/"},"gitHead":"26aa08178a80482dac15f789c047ffb0cc365adc","_id":"joi2gql@1.3.0","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"xogrp","email":"xo-npmjs.group@xogrp.com"},"dist":{"integrity":"sha512-i+jVHNbJi7g+cz7DC6S+XGYhUnzNh82w28nWMn3zwkcuPDdtgRp9C4VcTiuOi83mJWmrZwu3eTW2XM28Ad2z9g==","shasum":"d06297d90fe3d4687d50e657949d8918725afce5","tarball":"https://registry.npmjs.org/joi2gql/-/joi2gql-1.3.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8Z0K4GceIAVaeY7ZwFLLx0sAOH28RfKu6ZDhd8aIxzAIgIqK7XBEnjdtven18qlEKKJn4l6aiC58jsBdEGP/4bDw="}]},"maintainers":[{"name":"samueljoli","email":"samuel.joli.ftn@gmail.com"},{"name":"xogrp","email":"xo-npmjs.group@xogrp.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/joi2gql-1.3.0.tgz_1506465822904_0.5743855203036219"}},"1.3.1":{"name":"joi2gql","version":"1.3.1","private":false,"description":"Plugin","homepage":"https://github.com/xogroup/joi2gql#readme","main":"src/implementation.js","bugs":{"url":"https://github.com/xogroup/joi2gql/issues"},"repository":{"type":"git","url":"git+https://github.com/xogroup/joi2gql.git"},"keywords":["plugin","joi2gql","graphql","joi","schema"],"author":{"name":"Samuel Joli"},"license":"ISC","devDependencies":{"chai":"4.x.x","eslint":"3.x.x","eslint-plugin-xogroup":"1.x.x","graphql":"0.x.x","hoek":"4.x.x","joi":"10.x.x","lab":"14.x.x"},"peerDependencies":{"graphql":"0.x.x"},"dependencies":{"hoek":"4.2.0"},"scripts":{"test":"lab -t 100 -L -a chai","test-debug":"lab -a code","test-cov-html":"lab -r html -o coverage.html -a chai","lint":"eslint --fix src/ test/"},"gitHead":"a994054342d634bffeb98145c1d1887adaff0cdb","_id":"joi2gql@1.3.1","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"xogrp","email":"xo-npmjs.group@xogrp.com"},"dist":{"integrity":"sha512-Xhym7M4uPyMB0JOnvV3qjdFP2xCncL8wGFnVCEJ4XfocGRCp2/zNv1nmaWOmxAgz84HsnuVYs9uxTt1fM9dSEw==","shasum":"79d3e3ab12eca0dc42bc1aab0278fd29dab53858","tarball":"https://registry.npmjs.org/joi2gql/-/joi2gql-1.3.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBbf9TUdgbnBGvH0b3AQrJSbMjnpZBqgB5iHmZqqlw4oAiBHVqpy55oBdq/OjVkIXXlVdxJe1j3LzJffxTvsVAONjA=="}]},"maintainers":[{"name":"samueljoli","email":"samuel.joli.ftn@gmail.com"},{"name":"xogrp","email":"xo-npmjs.group@xogrp.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/joi2gql-1.3.1.tgz_1507161187174_0.5608211043290794"}}},"readme":"![alt text](http://i68.tinypic.com/xmpd20.png)\n\n[![Build Status](https://travis-ci.org/xogroup/joi2gql.svg?branch=master)](https://travis-ci.org/xogroup/joi2gql)\n[![npm version](https://badge.fury.io/js/joi2gql.svg)](https://badge.fury.io/js/joi2gql)\n\nEasily convert [Joi](https://github.com/hapijs/joi/) schemas into GraphQL data types.\n\nLead Mainter: [Samuel Joli](https://github.com/Samueljoli)\n\n## Installation \n```Text\nnpm install --save joi2gql\n```\n> graphql-js is listed as a peer dependency. `joi2gql` does not install it's own instance of graphql and instead requires parent module to provide it. This avoids any version collisions.\n\n## Example\n```js\nconst Joi    = require('joi');\nconst Joi2GQL = require('joi2gql');\n\nconst joiSchema = Joi.object().keys({\n    key1: Joi.string(),\n    key2: Joi.number().integer(),\n    key3: Joi.array().items(Joi.string()),\n    key4: Joi.object().keys({\n        subKey1: Joi.string(),\n        subKey2: Joi.number()\n    })\n});\n\nconst GraphQLDataType = Joi2GQL.transmuteType(joiSchema);\n```\n\n## Usage\n```js\nconst {\n    Server\n} = require('hapi');\nconst {\n    graphqlHapi \n} = require('apollo-server-hapi');\n\nconst Joi    = require('joi');\nconst Joi2GQL = require('joi2gql');\n\nconst port   = '3000';\nconst host   = 'localhost';\nconst server = new Server();\n\nserver.connection({ port, host });\n\nconst songSchema = Joi.object().keys({\n    artist: Joi.string(),\n    title : Joi.string(),\n    length: Joi.number().integer(),\n});\n\nconst config = {\n    name: 'Song',\n    args: {\n        id: Joi.number().integer()\n    },\n    resolve: (root, args) => {\n        return {\n            artist: 'Tycho',\n            title : 'Awake',\n            length: 4.43\n        };\n    }\n};\n\nconst Song = Joi2GQL.transmuteType(songSchema, config);\nconst rootGQLSchema = {\n    query: {\n        song: Song\n    }\n};\n\nserver.register({\n    register: graphqlHapi,\n    options : {\n        path          : '/graphql',\n        graphqlOptions: {\n            schema: Joi2GQL.transmuteSchema( rootGQLSchema )\n        }\n    }\n});\n\nserver.start(() => {\n    if (err) {\n        throw new Error(err);\n    }\n    \n    console.log(`Entering the matrix on port: ${server.info.port}`\n});\n```\n\n## API\nSee the detailed [API](https://github.com/xogroup/joi2gql/blob/master/API.md) reference.\n\n## Contributing\n\nWe love community and contributions! Please check out our [guidelines](http://github.com/xogroup/joi2gql/blob/master/.github/CONTRIBUTING.md) before making any PRs.\n\n## Setting up for development\n\nInstall dependencies and run test.\n\n```\nnpm install && npm test\n```\n\n## GraphQL types not yet supported.\n\n- `GraphQLInterfaceType`\n- `GraphQLUnionType`\n","maintainers":[{"name":"samueljoli","email":"samuel.joli.ftn@gmail.com"},{"name":"xogrp","email":"xo-npmjs.group@xogrp.com"}],"time":{"modified":"2022-05-06T15:41:56.413Z","created":"2017-09-20T21:15:32.274Z","1.1.3":"2017-09-20T21:15:32.274Z","1.2.0":"2017-09-24T02:10:19.004Z","1.3.0":"2017-09-26T22:43:43.858Z","1.3.1":"2017-10-04T23:53:08.110Z"},"homepage":"https://github.com/xogroup/joi2gql#readme","keywords":["plugin","joi2gql","graphql","joi","schema"],"repository":{"type":"git","url":"git+https://github.com/xogroup/joi2gql.git"},"author":{"name":"Samuel Joli"},"bugs":{"url":"https://github.com/xogroup/joi2gql/issues"},"license":"ISC","readmeFilename":"README.md"}