github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/hasura_inventory/inventory.go (about)

     1  package inventory
     2  
     3  import (
     4  	"github.com/ActiveState/cli/internal/gqlclient"
     5  	"github.com/ActiveState/cli/pkg/platform/api"
     6  	"github.com/ActiveState/cli/pkg/platform/authentication"
     7  )
     8  
     9  func New(auth *authentication.Auth) *gqlclient.Client {
    10  	client := gqlclient.New(api.GetServiceURL(api.ServiceHasuraInventory).String(), 0)
    11  
    12  	if auth != nil && auth.Authenticated() {
    13  		client.SetTokenProvider(auth)
    14  	}
    15  
    16  	return client
    17  }