~netlandish/links

588e0d4362f48be9c4f01284e9e9aba59714e6e5 — Peter Sanchez 2 months ago f647669
Adding workaround for updated gqlclient error wrapping
4 files changed, 22 insertions(+), 7 deletions(-)

M client.go
M cmd/test/helpers.go
M go.mod
M go.sum
M client.go => client.go +4 -0
@@ 80,5 80,9 @@ func Execute(ctx context.Context, op *gqlclient.Operation, result interface{}) e

	client = gqlclient.New(origin, httpClient)
	err := client.Execute(ctx, op, &result)
	if graphErrors, ok := err.(interface{ Unwrap() []error }); ok {
		errs := graphErrors.Unwrap()
		err = errs[0]
	}
	return err
}

M cmd/test/helpers.go => cmd/test/helpers.go +15 -4
@@ 28,6 28,7 @@ import (
	"github.com/99designs/gqlgen/graphql"
	"github.com/labstack/echo/v4"
	formguard "netlandish.com/x/gobwebs-formguard"
	gobwebsgql "netlandish.com/x/gobwebs-graphql"
	oauth2 "netlandish.com/x/gobwebs-oauth2"
	feedback "netlandish.com/x/gobwebs-ses-feedback"
	gaccts "netlandish.com/x/gobwebs/accounts"


@@ 172,10 173,20 @@ func NewAPITestServer(t *testing.T) (*server.Server, *echo.Echo, string) {
			core.TimezoneContext(),
			crypto.Middleware(entropy),
			core.InternalAuthMiddleware(accounts.NewUserFetch()),
		).
		WithSchema(schema, []string{
			"PROFILE", "LINKS", "ORGS", "DOMAINS", "BILLING", "ANALYTICS", "LISTS", "SHORTS",
		})
		)

	gqlGroup := e.Group("")
	ext := gobwebsgql.NewGQLExtension(gqlGroup, schema, []string{
		"PROFILE", "LINKS", "ORGS", "DOMAINS",
		"BILLING", "ANALYTICS", "LISTS", "SHORTS",
		"QRCODES",
	})

	srv, err = srv.Extend(ext)
	if err != nil {
		t.Fatalf("Error extending server with graphql: %v\n", err)
	}

	srv.AddFuncs(template.FuncMap{
		"buildURL": func(path string) string {
			baseURL := fmt.Sprintf("%s://%s", config.Scheme, config.Domain)

M go.mod => go.mod +1 -1
@@ 29,7 29,7 @@ require (
	golang.org/x/text v0.16.0
	netlandish.com/x/gobwebs v0.0.0-20240808204501-9f6e2ce74938
	netlandish.com/x/gobwebs-formguard v0.0.0-20231224192353-29706d23f156
	netlandish.com/x/gobwebs-graphql v0.0.0-20240808204814-d5296213dffe
	netlandish.com/x/gobwebs-graphql v0.0.0-20240813002048-cb0738b34957
	netlandish.com/x/gobwebs-oauth2 v0.0.0-20240216010400-f0f42e2e3a7c
	netlandish.com/x/gobwebs-ses-feedback v0.0.0-20231224192331-d90c2b73e55d
	petersanchez.com/x/carrier v0.2.1

M go.sum => go.sum +2 -2
@@ 2585,8 2585,8 @@ netlandish.com/x/gobwebs v0.0.0-20240808204501-9f6e2ce74938 h1:yJTZPnjffK+CJlael
netlandish.com/x/gobwebs v0.0.0-20240808204501-9f6e2ce74938/go.mod h1:q3yov9FuD8gSfERwdfNoAv73dzilRFZBJ3RHEOMuNMI=
netlandish.com/x/gobwebs-formguard v0.0.0-20231224192353-29706d23f156 h1:kbYL/3PDS6Pt5uE5QJWkVIgd+kzUgUUb3IKhAth35Bc=
netlandish.com/x/gobwebs-formguard v0.0.0-20231224192353-29706d23f156/go.mod h1:+73MG8iQ7+cs1rbcbgBEJd5so1TyFNmqrwLNKtDUAvg=
netlandish.com/x/gobwebs-graphql v0.0.0-20240808204814-d5296213dffe h1:AXkvf2JGpMGOm7VAJzgL73SBGo4ao+3khQfMBC+AVxU=
netlandish.com/x/gobwebs-graphql v0.0.0-20240808204814-d5296213dffe/go.mod h1:ReVNw5lGqLm1kxtTLXEIL4+hVNE2WjjBcoBtRfH9uWQ=
netlandish.com/x/gobwebs-graphql v0.0.0-20240813002048-cb0738b34957 h1:nyK91IZXByLuuiOAAAKz5oMceo18qAJfNNe9UFYWESw=
netlandish.com/x/gobwebs-graphql v0.0.0-20240813002048-cb0738b34957/go.mod h1:ReVNw5lGqLm1kxtTLXEIL4+hVNE2WjjBcoBtRfH9uWQ=
netlandish.com/x/gobwebs-oauth2 v0.0.0-20240216010400-f0f42e2e3a7c h1:OiR7uZB8Ix33d6uZcNucqWC53XQlJLqH5MyskIaFD20=
netlandish.com/x/gobwebs-oauth2 v0.0.0-20240216010400-f0f42e2e3a7c/go.mod h1:YFuvoy5GEi60A+UfPZyC87DTAwFLrvUldZL6dr+ks1o=
netlandish.com/x/gobwebs-ses-feedback v0.0.0-20231224192331-d90c2b73e55d h1:Qof6jqwfFMcmw08Qh5UocDsqjNIvpsZwZuxGqhbh8GE=