Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/r0busta/go-shopify-graphql

Shopify GraphQL client written in Go
https://github.com/r0busta/go-shopify-graphql

graphql shopify shopify-api

Last synced: 5 days ago
JSON representation

Shopify GraphQL client written in Go

Awesome Lists containing this project

README

        

# go-shopify-graphql

A simple client using the Shopify GraphQL Admin API.

## Getting started

Hello World example

### 1. Setup

```bash
export STORE_API_KEY=
export STORE_PASSWORD=
export STORE_NAME=
```

### 2. Program

```go
package main

import (
"context"
"fmt"

shopify "github.com/r0busta/go-shopify-graphql/v9"
)

func main() {
// Create client
client := shopify.NewDefaultClient()

// Get all collections
collections, err := client.Collection.ListAll(context.Background())
if err != nil {
panic(err)
}

// Print out the result
for _, c := range collections {
fmt.Println(c.Handle)
}
}
```

### 3. Run

```bash
go run .
```