Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(BUX-000): remove graphql before v1 release of bux toolbox #178

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
373 changes: 139 additions & 234 deletions buxclient_test.go

Large diffs are not rendered by default.

18 changes: 0 additions & 18 deletions client_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ func WithHTTP(serverURL string) ClientOps {
}
}

// WithGraphQL will overwrite the default client with a custom client
func WithGraphQL(serverURL string) ClientOps {
return func(c *BuxClient) {
if c != nil {
c.transportOptions = append(c.transportOptions, transports.WithGraphQL(serverURL))
}
}
}

// WithHTTPClient will overwrite the default client with a custom client
func WithHTTPClient(serverURL string, httpClient *http.Client) ClientOps {
return func(c *BuxClient) {
Expand All @@ -60,15 +51,6 @@ func WithHTTPClient(serverURL string, httpClient *http.Client) ClientOps {
}
}

// WithGraphQLClient will overwrite the default client with a custom client
func WithGraphQLClient(serverURL string, httpClient *http.Client) ClientOps {
return func(c *BuxClient) {
if c != nil {
c.transportOptions = append(c.transportOptions, transports.WithGraphQLClient(serverURL, httpClient))
}
}
}

// WithAdminKey will set the admin key for admin requests
func WithAdminKey(adminKey string) ClientOps {
return func(c *BuxClient) {
Expand Down
19 changes: 0 additions & 19 deletions examples/graphql/graphql.go

This file was deleted.

2 changes: 0 additions & 2 deletions go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 0 additions & 34 deletions transports/client_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,6 @@ func WithAccessKey(accessKey *bec.PrivateKey) ClientOps {
}
}

// WithGraphQL will overwrite the default client with a custom client
func WithGraphQL(serverURL string) ClientOps {
return func(c *Client) {
if c != nil {
c.transport = NewTransportService(&TransportGraphQL{
server: serverURL,
signRequest: c.signRequest,
adminXPriv: c.adminXPriv,
httpClient: &http.Client{},
xPriv: c.xPriv,
xPub: c.xPub,
accessKey: c.accessKey,
})
}
}
}

// WithHTTP will overwrite the default client with a custom client
func WithHTTP(serverURL string) ClientOps {
return func(c *Client) {
Expand All @@ -68,23 +51,6 @@ func WithHTTP(serverURL string) ClientOps {
}
}

// WithGraphQLClient will overwrite the default client with a custom client
func WithGraphQLClient(serverURL string, httpClient *http.Client) ClientOps {
return func(c *Client) {
if c != nil {
c.transport = NewTransportService(&TransportGraphQL{
server: serverURL,
signRequest: c.signRequest,
adminXPriv: c.adminXPriv,
httpClient: httpClient,
xPriv: c.xPriv,
xPub: c.xPub,
accessKey: c.accessKey,
})
}
}
}

// WithHTTPClient will overwrite the default client with a custom client
func WithHTTPClient(serverURL string, httpClient *http.Client) ClientOps {
return func(c *Client) {
Expand Down
5 changes: 1 addition & 4 deletions transports/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package transports

import buxmodels "github.com/BuxOrg/bux-models"

// TransportType the type of transport being used (http or graphql)
// TransportType the type of transport being used ('http' for usage or 'mock' for testing)
type TransportType string

// BuxUserAgent the bux user agent sent to the bux server
Expand All @@ -15,9 +15,6 @@ const (
// BuxTransportHTTP uses the http transport for all bux server actions
BuxTransportHTTP TransportType = "http"

// BuxTransportGraphQL uses the graphql transport for all bux server actions
BuxTransportGraphQL TransportType = "graphql"

// BuxTransportMock uses the mock transport for all bux server actions
BuxTransportMock TransportType = "mock"
)
Expand Down
Loading
Loading