Navigation

    Quasar Framework

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Apollo graphql

    Help
    apollo graphql
    2
    3
    17
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      nededa last edited by nededa

      Hello,
      I’m trying to use vue-apollo with composition API and in docs it says that I should add this code to root file but there isn’t one.

      Where exactly should I place it?

      import { provide } from '@vue/composition-api'
      import { DefaultApolloClient } from '@vue/apollo-composable'
      
      const app = new Vue({
        setup () {
          provide(DefaultApolloClient, apolloClient)
        },
      
        render: h => h(App),
      })
      

      Docs url: https://v4.apollo.vuejs.org/guide-composable/setup.html#_1-install-vue-apollo-composable

      beets 1 Reply Last reply Reply Quote 0
      • beets
        beets @nededa last edited by

        @nededa Try putting it in App.vue

        1 Reply Last reply Reply Quote 1
        • N
          nededa last edited by

          Yes it worked, thanks. 🙂

          1 Reply Last reply Reply Quote 0
          • First post
            Last post