vue-wordpress-graphql
v1.0.3
Published
A npm package for integrating WordPress GraphQL into a Vue application.
Downloads
3
Maintainers
Readme
WordPress GraphQL Integration Package
This npm package provides functionality to integrate WordPress posts via GraphQL into your applications. It allows you to fetch posts from a WordPress site using GraphQL queries.
Installation
You can install this package via npm. Run the following command:
npm install vue-wordpress-graphql
Usage
Import the fetchPosts
function from the package and use it to retrieve posts from your WordPress site using GraphQL.
import fetchPosts from 'vue-wordpress-graphql';
// Provide your GraphQL URI
const uri = 'https://your-wordpress-site.com/graphql';
// Fetch posts
fetchPosts(uri)
.then(posts => {
console.log('Posts:', posts);
// Handle posts data
})
.catch(error => {
console.error('Error fetching posts:', error);
// Handle error
});`
License
This package is licensed under the MIT License.