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

Add a guide to the documentation for Nuxt 3 Support #153

Open
sasial-dev opened this issue Mar 19, 2022 · 1 comment
Open

Add a guide to the documentation for Nuxt 3 Support #153

sasial-dev opened this issue Mar 19, 2022 · 1 comment
Labels
📚 documentation Improvements or additions to documentation

Comments

@sasial-dev
Copy link

As a first time user to the repo, I had a quick look at the issues and there's a lot about Nuxt 3. As a fellow Nuxt 3 user, it would be helpful to have a nuxt/SSR guide.

@logaretm logaretm added the 📚 documentation Improvements or additions to documentation label Mar 20, 2022
@Siilwyn
Copy link

Siilwyn commented Jan 31, 2024

It's pretty straightforward I think unless I'm missing something?

In Nuxt's plugins directory create a file, e.g. villus.ts with:

import { createClient } from 'villus';

export default defineNuxtPlugin(({ vueApp }) => {
  const client = createClient({
    url: 'https://graphql.datocms.com/',
  });

  vueApp.use(client)
});

Then in your pages you can use useQuery.

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

No branches or pull requests

3 participants