https://github.com/devetek/gowpgql
Golang WordPress interface through GraphQL by WPGraphQL
https://github.com/devetek/gowpgql
golang graphql wordpress
Last synced: 2 months ago
JSON representation
Golang WordPress interface through GraphQL by WPGraphQL
- Host: GitHub
- URL: https://github.com/devetek/gowpgql
- Owner: devetek
- Created: 2023-12-05T11:53:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-09T15:14:30.000Z (over 1 year ago)
- Last Synced: 2025-01-21T14:13:20.346Z (4 months ago)
- Topics: golang, graphql, wordpress
- Language: Go
- Homepage: https://cloud.devetek.com/
- Size: 15.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Description
GoWPGQL is an interface to communicate with WordPress through GraphQL by [WPGraphQL](https://www.wpgraphql.com/). Integrate with repository [Wordpress Playground](https://github.com/devetek/wpgraphql-playground) to play around with Wordpress.
### Prerequisite
Wordpress engine with WPGraphQL enabled, use [Wordpress Playground](https://github.com/devetek/wpgraphql-playground) to test GoWPGQL examples.
### Usage
1. Get Posts
```sh
package mainimport (
"fmt""github.com/devetek/gowpgql"
)func main() {
var wpGQLURL = "https://graphql.terpusat.com/"gql := gowpgql.New(wpGQLURL)
// get post without variables
posts := gql.Posts(1, 0, "", "", nil)fmt.Println(posts)
}
```### Examples
1. Use common available interface from GoWPGQL
```sh
make run-example-all-list
```1. Define your custom model, if it not supported to your wordpress data structure
```sh
make run-example-with-external
```## Todo
- [ ] Migrate wordpress common data to completing golang wordpress interface