Apollo Graphql事件验证失败

时间:2019-08-22 01:11:24

标签: mongodb graphql apollo

我有一个输入类型的突变,但是响应是事件验证失败,如果尝试使用相同的突变但每个参数都输入,猫鼬验证是正确的。

这是阿波罗2号。

//Mutation fine

Mutation: {
    createEvent: combineResolvers(
      isAuthenticated,
      async (parent, { text, description }, { models, me }) => {
        const event = await models.Event.create({
          text,description,
          userId: me.id,
        });

        pubsub.publish(EVENTS.EVENT.CREATED, {
          eventCreated: { event },
        });

        return event;
      },
    ),

//Mutation with errors

    createEventInput: combineResolvers(
      isAuthenticated,
      async (root, { input }, { models, me }) => {
        const event = await models.Event.create(input,{
            userId: me.id,
        });

        pubsub.publish(EVENTS.EVENT.CREATED, {
          eventCreated: { event },
        });
        return event;
      },
    ),

错误:

  

“错误”:[{“消息”:“事件验证失败:描述:需要路径描述。,文本:需要路径文本。”,“位置”:

0 个答案:

没有答案