Skip to content

Instantly share code, notes, and snippets.

@a7v8x
Created May 2, 2020 12:00
Show Gist options
  • Save a7v8x/716b5739e484435bc9033089841ae838 to your computer and use it in GitHub Desktop.
Save a7v8x/716b5739e484435bc9033089841ae838 to your computer and use it in GitHub Desktop.
import {
GraphQLString,
GraphQLInputObjectType,
GraphQLNonNull,
GraphQLBoolean,
GraphQLInt,
GraphQLFloat,
} from 'graphql';
import TaskStateEnum from './TaskStateEnumType';
import DateTime from '../custom-scalars/DateTime';
const CreateTaskInputType = new GraphQLInputObjectType({
name: 'CreateTaskInput',
fields: () => ({
name: {
type: new GraphQLNonNull(GraphQLString),
},
completed: {
type: GraphQLBoolean,
defaultValue: false,
},
state: {
type: TaskStateEnum,
defaultValue: TaskStateEnum.getValue("ASSIGNED"),
},
taskPriority: {
type: GraphQLInt,
defaultValue: 1,
},
progress: {
type: GraphQLFloat,
defaultValue: 0,
},
dueDate: {
type: DateTime,
},
}),
});
export default CreateTaskInputType;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment