module.export = {} with Vite React

module.export = {} with Vite React


0

I created a react App with Vite, and I want to use Apollo extension to get Intellisense when building GraphQL queries.

According to the extension docs, I created an apollo.config.js file at the root with this code :

module.exports = {
  client: {
    service: {
      name: "my-graphql-app",
      url: "https://localhost:4000/graphql",
    },
  },
};

But since my React app is of type : module , eslint warns me with a "module not found". Thus Apollo extension cannot find the config file.

I tried by turning it into a ESModule, exporting it :

export const client=  {
    service: {
      name: "my-graphql-app",
      url: "https://localhost:4000/graphql",
    },
  },

But although the error about not finding the config file goes away, nothing else happens.

Any hints to fix this would be much appreciated.


Load 4 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *