<i id='Q4LSe'><tr id='Q4LSe'><dt id='Q4LSe'><q id='Q4LSe'><span id='Q4LSe'><b id='Q4LSe'><form id='Q4LSe'><ins id='Q4LSe'></ins><ul id='Q4LSe'></ul><sub id='Q4LSe'></sub></form><legend id='Q4LSe'></legend><bdo id='Q4LSe'><pre id='Q4LSe'><center id='Q4LSe'></center></pre></bdo></b><th id='Q4LSe'></th></span></q></dt></tr></i><div id='Q4LSe'><tfoot id='Q4LSe'></tfoot><dl id='Q4LSe'><fieldset id='Q4LSe'></fieldset></dl></div>
  • <legend id='Q4LSe'><style id='Q4LSe'><dir id='Q4LSe'><q id='Q4LSe'></q></dir></style></legend>

        <bdo id='Q4LSe'></bdo><ul id='Q4LSe'></ul>
      1. <tfoot id='Q4LSe'></tfoot>

        <small id='Q4LSe'></small><noframes id='Q4LSe'>

      2. Sequelize on GraphQL update 不返回任何内容

        Sequelize on GraphQL update not return anything(Sequelize on GraphQL update 不返回任何内容)

        <small id='STBtr'></small><noframes id='STBtr'>

        <legend id='STBtr'><style id='STBtr'><dir id='STBtr'><q id='STBtr'></q></dir></style></legend>

            • <i id='STBtr'><tr id='STBtr'><dt id='STBtr'><q id='STBtr'><span id='STBtr'><b id='STBtr'><form id='STBtr'><ins id='STBtr'></ins><ul id='STBtr'></ul><sub id='STBtr'></sub></form><legend id='STBtr'></legend><bdo id='STBtr'><pre id='STBtr'><center id='STBtr'></center></pre></bdo></b><th id='STBtr'></th></span></q></dt></tr></i><div id='STBtr'><tfoot id='STBtr'></tfoot><dl id='STBtr'><fieldset id='STBtr'></fieldset></dl></div>
            • <tfoot id='STBtr'></tfoot>
                <bdo id='STBtr'></bdo><ul id='STBtr'></ul>
                  <tbody id='STBtr'></tbody>

                  本文介绍了Sequelize on GraphQL update 不返回任何内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  GraphQL 使用 Sequelize 更新返回 null.

                  GraphQL return null using Sequelize update.

                  updatePerson: {
                    type: Person,
                    args: {
                      value: {
                        type: UpdatePersonInputType
                      },
                      where: {
                        type: WhereUpdatePersonInputType
                      }
                    },
                    resolve(_, args) {
                      return Db.models.persons.update( args.value, {
                        where: args.where
                      });
                    }
                  },
                  

                  这是我使用 GraphiQL 的请求

                  Here my request using GraphiQL

                  mutation {
                    updatePerson(value: {firstName: "John", lastName: "Doe", email: "johndoe@example.com"}, where: {id: 1}){
                      id
                      firstName
                      lastName
                      email
                    }
                  }
                  

                  这就是结果

                  {
                    "data": {
                      "updatePerson": {
                        "id": null,
                        "firstName": null,
                        "lastName": null,
                        "email": null
                      }
                    }
                  }
                  

                  也许我在使用 Sequelize 更新时会出错.谁能解释发生了什么?

                  Maybe I make mistakes using Sequelize update. Can anyone explain what happens?

                  推荐答案

                  不好意思,我用的是MySQLSequelize只支持PostgreSQL> 如果需要返回affectedRows,但如果使用MySQL则只能返回affectedCount.

                  My bad, I'm using MySQL, Sequelize just support PostgreSQL if you need return affectedRows, but if you use MySQL you just can only return affectedCount.

                  http://docs.sequelizejs.com/en/latest/api/model/#updatevalues-options-promisearrayaffectedcount-affectedrows

                  这篇关于Sequelize on GraphQL update 不返回任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Pause youtube video, youtube api(暂停 youtube 视频,youtube api)
                  Youtube iframe api not triggering onYouTubeIframeAPIReady(Youtube iframe api 未触发 onYouTubeIframeAPIReady)
                  How can I stop a video with Javascript in Youtube?(如何在 Youtube 中停止使用 Javascript 的视频?)
                  How to call Greasemonkey#39;s GM_ functions from code that must run in the target page scope?(如何从必须在目标页面范围内运行的代码中调用 Greasemonkey 的 GM_ 函数?)
                  How do you mute an embedded Youtube player?(如何使嵌入式 Youtube 播放器静音?)
                  How to get number of video views with YouTube API?(如何使用 YouTube API 获取视频观看次数?)
                1. <tfoot id='zbOEv'></tfoot>

                  • <i id='zbOEv'><tr id='zbOEv'><dt id='zbOEv'><q id='zbOEv'><span id='zbOEv'><b id='zbOEv'><form id='zbOEv'><ins id='zbOEv'></ins><ul id='zbOEv'></ul><sub id='zbOEv'></sub></form><legend id='zbOEv'></legend><bdo id='zbOEv'><pre id='zbOEv'><center id='zbOEv'></center></pre></bdo></b><th id='zbOEv'></th></span></q></dt></tr></i><div id='zbOEv'><tfoot id='zbOEv'></tfoot><dl id='zbOEv'><fieldset id='zbOEv'></fieldset></dl></div>

                          <tbody id='zbOEv'></tbody>
                        <legend id='zbOEv'><style id='zbOEv'><dir id='zbOEv'><q id='zbOEv'></q></dir></style></legend>

                          <small id='zbOEv'></small><noframes id='zbOEv'>

                            <bdo id='zbOEv'></bdo><ul id='zbOEv'></ul>