Created
October 5, 2017 00:28
-
-
Save samueljoli/3d8468217524fe47aebecc8b3c770321 to your computer and use it in GitHub Desktop.
Joi2GQL example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const schema = Joi.object().keys({ | |
| title: Joi.string(), | |
| director: Joi.string(), | |
| actors: Joi.array(Joi.string()) | |
| }); | |
| const options = { | |
| name: 'Film', | |
| args: { id: Joi.string().guid() }, | |
| resolve: (root, args) => { | |
| //...return object | |
| } | |
| }; | |
| const Film = Joi2GQL.transmuteType(schema, options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment