Cosmo: Full Lifecycle GraphQL API Management
Are you looking for an Open Source Graph Manager? Cosmo is the most complete solution including Schema Registry, Router, Studio, Metrics, Analytics, Distributed Tracing, Breaking Change detection and more.
After React and Solid, we now have official Vue support! 🎉.
This new client is built on top of Vue Query , and brings all the good stuff from WunderGraph to the Vue ecosystem. Query, mutate and subscribe to your WunderGraph API fully typesafe in Vue.
The integration has been built by one of our community members, Hebilicious . Thanks Emmanuel, you rock!
Let's have a quick look at how to set it up in a Nuxt project and how to use it. (this assumes you already have Nuxt and WunderGraph installed).
Install the Vue Query client:
Before you can use the hooks, you need to modify your code generation to include the base typescript client.
Now we need to configure the Vue Query client. We'll create a plugin for this.
Turn queries into live queries, live queries are refetched on a interval on the WunderGraph server.
Build realtime apps with subscriptions.
Let's say we have a query that fetches the current user's profile in one component and we have a form that updates the profile. We can add an
onSuccess handler to the mutation that calls
queryClient.invalidateQueries on the
GetProfile query and trigger a refetch and update the internal React Query cache.
Check out the reference and example app below to learn more about the new Vue Query integration.
We're very excited to see the community building integrations for WunderGraph. If you have ideas for other integrations, let us know in the comments below or join us on our Discord server .