node-graphql-server icon indicating copy to clipboard operation
node-graphql-server copied to clipboard

Default value doesn't work

Open PeterT11 opened this issue 6 years ago • 1 comments

I tried to play with the 'basic' project and found that I can't use createDraft mutation: playground app but I can use createPost without 'isPublished' value because this key has a default value. playground database 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 avatar Apr 20 '18 07:04 PeterT11

@PeterT11 I tried setting up the same project and I was able to createDraft. screen shot 2018-07-01 at 4 09 58 am

vivek12345 avatar Jun 30 '18 22:06 vivek12345