Skip to content

Instantly share code, notes, and snippets.

@samueljoli
Created October 5, 2017 00:28
Show Gist options
  • Select an option

  • Save samueljoli/3d8468217524fe47aebecc8b3c770321 to your computer and use it in GitHub Desktop.

Select an option

Save samueljoli/3d8468217524fe47aebecc8b3c770321 to your computer and use it in GitHub Desktop.
Joi2GQL example
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