Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hey! Sorry, I can't figure out how to setup connection mode #106

Closed
fesh-biz opened this issue Jun 9, 2019 · 2 comments
Closed

Hey! Sorry, I can't figure out how to setup connection mode #106

fesh-biz opened this issue Jun 9, 2019 · 2 comments

Comments

@fesh-biz
Copy link

fesh-biz commented Jun 9, 2019

I had installed quasar and configured vuex-orm, but I can't get rid of nodes from queries

I keep getting this Connection Query Mode is 2 by config

This is my config of store

import Vue from 'vue'
import Vuex from 'vuex'
import VuexOrm from '@vuex-orm/core'
import VuexORMGraphQL from '@vuex-orm/plugin-graphql'

Vue.use(Vuex)

global.database = new VuexOrm.Database()
require('../models/autoloader')

VuexOrm.use(VuexORMGraphQL, {
  database,
  debug: true,
  connectionQueryMode: 'edges',
})

const store = new Vuex.Store({
  modules: {
  },

  plugins:[
    VuexOrm.install(database, {
      ConnectionMode: 3
    })
  ],

  // enable strict mode (adds overhead!)
  // for dev mode only
  strict: process.env.DEV
})

export default store

But any my changes to connectionQueryMode doesn't make any affects

packacge.json strings is

"@vuex-orm/core": "^0.31.12",
"@vuex-orm/plugin-graphql": "^1.0.0-rc.35",
@phortx
Copy link
Collaborator

phortx commented Jun 10, 2019

That's because connectionQueryMode was deprecated with Release 1.0.0-rc.34.

You can change it now via the adapter pattern now.

However the documentation was not deployed for some reason. I've fixed that. Sorry for that! :)

@phortx phortx closed this as completed Jun 10, 2019
@simkuns
Copy link

simkuns commented Oct 15, 2019

In case someone is still wondering how to set up connection mode. https://vuex-orm.github.io/plugin-graphql/guide/adapters.html#basics

// custom-adapter.js
import { DefaultAdapter, ConnectionMode } from "@vuex-orm/plugin-graphql"

export default class CustomAdapter extends DefaultAdapter {
    constructor() {
        super()
    }

    getConnectionMode() {
        return ConnectionMode.EDGES
    }

    // Your code
}
// store.js
import CustomAdapter from './custom-adapter'; 

// ...

VuexORM.use(VuexORMGraphQL, {
  database,
  adapter: new CustomAdapter(),
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants