Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Last active July 3, 2016 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuck0523/2194d2984a7bc0f33b8383d5085fb718 to your computer and use it in GitHub Desktop.
Save chuck0523/2194d2984a7bc0f33b8383d5085fb718 to your computer and use it in GitHub Desktop.
var jobType = new GraphQLObjectType({
name: 'Job',
description: 'A job',
fields: () => ({
id: globalIdField('Job'),
name: {
type: GraphQLString,
description: 'The name of the job',
resolve: (job) => job.name,
},
salary: {
type: GraphQLInt,
description: 'The salary of the job',
resolve: (job) => job.salary,
},
location: {
type: GraphQLString,
description: 'The place of the job',
resolve: (job) => job.location
},
detail: {
type: GraphQLString,
description: 'The detail explanation of the job',
resolve: (job) => job.detail
},
hasApplied: {
type: GraphQLBoolean,
description: 'If the user applied for this job or not',
resolve: (job) => job.hasApplied
}
}),
interfaces: [nodeInterface],
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment