-
Notifications
You must be signed in to change notification settings - Fork 492
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
Any Fork Maintaining Gridsome? Gridsome graphql port to Nuxt ? #1653
Comments
I'd prefer seeing something like Gridsome's data layer ported as a Nuxt plugin. Given both Nuxt and Gridsome overlap on lots of the things they do, I think this might have the potential to reach a bigger audience while reducing the scope of the project as it exists now. Not sure how easy doing something like this would be and I don't even know if the current architecture for Nuxt modules/plugins would support. |
Its an amazing idea, I will do some poc this week with nuxt v3 and see if this is possible. |
Hey @milindsingh, did you figure out anything cool? 😄 |
@milindsingh detailed below is poc. It's not a replication of Gridsome's data layer but a way to do something similar in Nuxt 3 🔥 The library that you'll use in Nuxt is this. You'll be using query which has a mongodb query syntax (so no Graphql here). You'll also need to create a At first glance this won't seem like a viable option, but it's similar to the gridsome data layer in the fact that you can access data from any of your Nuxt pages/components. Your biggest hurdle is now physically creating that data on start up of nuxt dev instances/when building. You'll want to hook into Once you've written your physical files, you can now access them in your setup function using queries like so: I know, this is wild but it works It gets even spicier when you want to dynamically generate files like Gridsome's templates. Let's say you have a list of blogs you want to generate. Still inside of "nitro:config" you'll add these dynamic routes yourself like so You'll need to read up on how Nuxt handles generating dynamic pages. Sorry for the huge post, but I just wanted to say that it is possible to create your own data layer but it is extremely tough and confusing 🫠 A plugin would be great, but right now you can use these steps to get something running in Nuxt |
Just to add to the convo, Nuxt's content module introduced two hooks in v2.3.0 that perhaps could be used to add the documents as @jacobsteenstenersen mentioned. Not sure how you'd use them or if they would allow for what has been discussed but I thought it would be a good idea to share here since it could help anyone willing to look into it 👍 |
Is there any fork maintaining Gridsome?
Or Shall I create one ?
The text was updated successfully, but these errors were encountered: