{"action":"created","issue":{"url":"https://api.github.com/repos/ironhee/nothinkdb-graphql/issues/2","repository_url":"https://api.github.com/repos/ironhee/nothinkdb-graphql","labels_url":"https://api.github.com/repos/ironhee/nothinkdb-graphql/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/ironhee/nothinkdb-graphql/issues/2/comments","events_url":"https://api.github.com/repos/ironhee/nothinkdb-graphql/issues/2/events","html_url":"https://github.com/ironhee/nothinkdb-graphql/pull/2","id":135298727,"number":2,"title":"Scalar type","user":{"login":"jeongsd","id":7903426,"avatar_url":"https://avatars.githubusercontent.com/u/7903426?v=3","gravatar_id":"","url":"https://api.github.com/users/jeongsd","html_url":"https://github.com/jeongsd","followers_url":"https://api.github.com/users/jeongsd/followers","following_url":"https://api.github.com/users/jeongsd/following{/other_user}","gists_url":"https://api.github.com/users/jeongsd/gists{/gist_id}","starred_url":"https://api.github.com/users/jeongsd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeongsd/subscriptions","organizations_url":"https://api.github.com/users/jeongsd/orgs","repos_url":"https://api.github.com/users/jeongsd/repos","events_url":"https://api.github.com/users/jeongsd/events{/privacy}","received_events_url":"https://api.github.com/users/jeongsd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-22T02:55:09Z","updated_at":"2016-02-22T05:27:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ironhee/nothinkdb-graphql/pulls/2","html_url":"https://github.com/ironhee/nothinkdb-graphql/pull/2","diff_url":"https://github.com/ironhee/nothinkdb-graphql/pull/2.diff","patch_url":"https://github.com/ironhee/nothinkdb-graphql/pull/2.patch"},"body":"#### resolve joi custom validate type([email, url, .etc](https://github.com/hapijs/joi/blob/v8.0.2/API.md)) to [GraphQLScalarType](http://graphql.org/docs/api-reference-type-system/#graphqlscalartype)\r\n\r\n\r\nif joi schema set `{ isScalar: true }` in meta data, then return `GraphQLJoiType`\r\n```javascript\r\n{\r\n  id: Joi.string(), // -> GraphQLString\r\n  email: Joi.string().email().meta({ isScalar: true }), // -> GraphQLJoiType\r\n  username: Joi.string().min(3).max(5).meta({ isScalar: true }), // -> GraphQLJoiType\r\n}\r\n```\r\n\r\n`GraphQLJoiType` was just extend [GraphQLScalarType](http://graphql.org/docs/api-reference-type-system/#graphqlscalartype) with using `joi` validation\r\n\r\n#### add enum type"},"comment":{"url":"https://api.github.com/repos/ironhee/nothinkdb-graphql/issues/comments/187020711","html_url":"https://github.com/ironhee/nothinkdb-graphql/pull/2#issuecomment-187020711","issue_url":"https://api.github.com/repos/ironhee/nothinkdb-graphql/issues/2","id":187020711,"user":{"login":"jeongsd","id":7903426,"avatar_url":"https://avatars.githubusercontent.com/u/7903426?v=3","gravatar_id":"","url":"https://api.github.com/users/jeongsd","html_url":"https://github.com/jeongsd","followers_url":"https://api.github.com/users/jeongsd/followers","following_url":"https://api.github.com/users/jeongsd/following{/other_user}","gists_url":"https://api.github.com/users/jeongsd/gists{/gist_id}","starred_url":"https://api.github.com/users/jeongsd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeongsd/subscriptions","organizations_url":"https://api.github.com/users/jeongsd/orgs","repos_url":"https://api.github.com/users/jeongsd/repos","events_url":"https://api.github.com/users/jeongsd/events{/privacy}","received_events_url":"https://api.github.com/users/jeongsd/received_events","type":"User","site_admin":false},"created_at":"2016-02-22T05:27:06Z","updated_at":"2016-02-22T05:27:06Z","body":"```javascript\r\n // user.js\r\n      export default toGraphqlSchema({\r\n        email: emailType,\r\n      });\r\n      \r\n      export defualt { \r\n        email: Joi.string().email().meta({ \r\n          GraphQLType: new GraphQLJoiType({\r\n            name: 'email',\r\n            schema: Joi.string().email(),\r\n          }),\r\n        });\r\n      }\r\n\r\n      if (meta.GraphQLType) {\r\n        return meta.GraphQLType;\r\n      }\r\n      \r\n      // import { emailType } from '../types/user';\r\n      export const GraphQLEmailType = new GraphQLJoiType({\r\n        name: 'email',\r\n        schema: Joi.string().email(),\r\n      });\r\n\r\n      schema = {\r\n        userEmail: GraphQLEmailType.schema,\r\n      }\r\n```"}}