Skip to content

Instantly share code, notes, and snippets.

@chuck0523

chuck0523/schema.js

Last active Jul 3, 2016
Embed
What would you like to do?
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