-
-1 votesanswersviews
尝试在Vue.js应用程序中添加消息时出现Graphql Apollo错误
Vue方法为帖子创建消息 createMessage() { const variables = { userId: this.user._id, postId: this.postId, messageBody: this.message }; console.log(this.message); this.$apollo .mutate({ ... -
1 votesanswersviews
订阅GraphQL Server时出错
我是GraphQl的新手,我在这里遵循了GraphQL NodeJS后端教程:GraphQL Realtime Subscriptions . 一切都运作良好,我完成了教程 . 接下来我在这里跟随VueJS和Apollo前端教程:Vue & Apollo Subscriptions . 我选择在第一个教程中使用我自己创建的GraphQL服务器,而不是使用在前端教程中使用的GraphCool... -
0 votesanswersviews
无法通过突变修改vuex状态
所以我的商店里有这个突变: DELETE_POST: (state, index) => { state.Posts.splice(index, 1); } 我也有这个动作: delete({ commit, state }, index) { commit('DELETE_POST', index); } 此操作基本上删除了通过vue-apollo返回的帖子数组中的帖子 . 在... -
1 votesanswersviews
在Vue.js中向用户显示Apollo变异错误?
我正在使用带有Vue-Apollo的Vue.js并启动用户突变来登录用户 . 我正在使用graph.cool服务 . 我有一个请求管道功能设置来捕获一些错误,如无效的电子邮件 . 当使用错误/无效输入发出请求时,我的错误 catch() 会触发(如预期的那样),并且在网络选项卡中,我可以看到自定义错误消息的JSON . 但是如果从graph.cool触发错误,如何从catch中访问这些错误/响应?... -
0 votesanswersviews
如何在vue-apollo客户端中定义GraphQL输入类型
情况: 我使用laravel-graphql作为后端GraphQL服务,使用vue-apollo作为前端客户端 . 在我的Vue组件中,我有一个gql查询,如下所示:(关系:一首歌有更多的SongPart) const getSong = gql` query FetchSong ($id:Int!){ song(id: $id) { id, ... -
0 votesanswersviews
GraphQL vue apollo查询和变异相同的视图
我刚刚开始使用GraphQL和Apollo和Vue,所以这可能是一个“愚蠢”的问题,但我无法想象该怎么做 . 如何在同一视图内部执行查询以获取一个对象,并使用突变更新它 假设我有一个简单的架构 type Product { id: ID! title: String! description: String } 和一个vue组件 <script> // Gra... -
2 votesanswersviews
Vue App中的Mock GraphQL
我正在使用Vue.js开发客户端应用程序,使用jest进行测试,并使用Vue-apollo请求外部graphql endpoints . 我的疑问是,如何在我的测试或我的应用程序中模拟此服务器请求? 什么是最好的方法,模拟测试或虚假数据的应用程序? 谢谢 . -
2 votesanswersviews
如何使用Apollo在Vue中实现有效的Graphql查询?
有人可以帮助我让我的第一个查询与scaphold.io一起工作吗? 当我使用内部GraphiQL查询以下内容时: query AllPrograms { viewer { allPrograms{ edges { node { id name } } } } } 返回看起来像这... -
1 votesanswersviews
vue-apollo在路由器防护中执行graphql查询
我有一个用户可以注册参加活动的应用程序 . 一旦用户注册,他就可以访问他以前无法访问的路线 . 我正在使用graphql来处理我的api请求 . 我的路线保护中的代码如下所示: router.beforeEach(async (to, from, next) => { if (to.meta.signUpRequired && from.name) { const... -
0 votesanswersviews
GraphQL Apollo-client(PhpStorm)中的Format / Prettyprint gql`模板字符串`
当我有 query: gql`query FetchUsers { users { id email }}` 什么是快速的方式使它看起来像这样: query: gql`query FetchUsers { users { id email } ... -
0 votesanswersviews
[vue-apollo]:查询getTeam发生错误
我正在工作vue-apollo,目前我遇到了问题: Workspace.vue <script> import { GetTeam } from '../constants/query.gql' export default { name: 'Workspace', data() { return { ...