node-graphql-server
node-graphql-server copied to clipboard
Default value doesn't work
I tried to play with the 'basic' project and found that I can't use createDraft mutation:
but I can use createPost without 'isPublished' value because this key has a default value.
if I add a line in the index.js, it will work fine.
createDraft(parent, { title, text }, ctx, info) {
return ctx.db.mutation.createPost(
{
data: {
isPublished:false, //add it this value.
title,
text,
},
},
info,
)
},
Could anyone explain what's the problem? or is it a bug?
@PeterT11 I tried setting up the same project and I was able to createDraft.