Giter VIP home page Giter VIP logo

Comments (2)

ejez avatar ejez commented on May 27, 2024

Hi @Quasarman

If you want to manipulate the apollo client or provider (after their creation) or their configs (before their creation), you can do so using the provided hooks. If that is not enough, you can unregister the extension by removing it from quasar.extensions.json and registering its boot file manually in quasar.conf.js in the order you need it in.

quasar.extensions.json

{
...
-  "@quasar/apollo": {
-    "graphql_uri": "https://example.com/graphql"
-  }
...
}

quasar.conf.js

-module.exports = function (/* ctx */) {
+module.exports = function (ctx) {
...
     boot: [
+      '~@quasar/quasar-app-extension-apollo/src/boot/' + (ctx.mode.ssr ? 'apollo-ssr' : 'apollo'),
       'my-other-boot-file-that-should-run-after-apollo'
     ],
...
     build: {
      env: {
          ...
+        GRAPHQL_URI: process.env.GRAPHQL_URI // to allow overriding the uri with `GRAPHQL_URI=https://example.com/graphql quasar dev`
      },

(Take a look at https://github.com/quasarframework/app-extension-apollo/blob/182654829e90ef4e2d8ab43f3c96c3edb0d7adf6/src/index.js lines 8 and 15)

Now you can access apolloProvider in your boot file:

  console.log(app.apolloProvider.defaultClient.version)

To explain why the extension boot file is run last, we used conf.boot.push which pushes the boot file to the end of the boot files array (may be not the best choice 😄 ).

from app-extension-apollo.

Quasarman avatar Quasarman commented on May 27, 2024

Hello @ejez

Thanks for the detailed explantation this helps alot!

from app-extension-apollo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.