diff --git a/README.md b/README.md index 7c31181..c6c3dd5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -# Graphql library for GoLang +![Banner](https://github.com/mjarkk/yarql/blob/main/banner.png?raw=true) -[![Go Reference](https://pkg.go.dev/badge/github.com/mjarkk/go-graphql.svg)](https://pkg.go.dev/github.com/mjarkk/go-graphql) [![Go Report Card](https://goreportcard.com/badge/github.com/mjarkk/go-graphql)](https://goreportcard.com/report/github.com/mjarkk/go-graphql) [![Coverage Status](https://coveralls.io/repos/github/mjarkk/go-graphql/badge.svg?branch=main)](https://coveralls.io/github/mjarkk/go-graphql?branch=main) +[![Go Reference](https://pkg.go.dev/badge/github.com/mjarkk/yarql.svg)](https://pkg.go.dev/github.com/mjarkk/yarql) [![Go Report Card](https://goreportcard.com/badge/github.com/mjarkk/yarql)](https://goreportcard.com/report/github.com/mjarkk/yarql) [![Coverage Status](https://coveralls.io/repos/github/mjarkk/go-graphql/badge.svg?branch=main)](https://coveralls.io/github/mjarkk/go-graphql?branch=main) + +# YarQL, A Graphql library for GoLang Just a different approach to making graphql servers in Go @@ -11,20 +13,21 @@ Just a different approach to making graphql servers in Go - Build on top of the [graphql spec 2021](https://spec.graphql.org/October2021/) - No code generators - [Only 1 dependency](go.mod) -- Easy to implement in many web servers, see the [gin](https://github.com/mjarkk/go-graphql/blob/main/examples/gin/main.go) and [fiber](https://github.com/mjarkk/go-graphql/blob/main/examples/fiber/main.go) examples +- Easy to implement in many web servers, see the [gin](https://github.com/mjarkk/yarql/blob/main/examples/gin/main.go) and [fiber](https://github.com/mjarkk/yarql/blob/main/examples/fiber/main.go) examples - [File upload support](#file-upload) - Supports [Apollo tracing](https://github.com/apollographql/apollo-tracing) +- [Fast](#Performance) ## Example -See the [/examples](https://github.com/mjarkk/go-graphql/tree/main/examples) folder for more examples +See the [/examples](https://github.com/mjarkk/yarql/tree/main/examples) folder for more examples ```go package main import ( "log" - "github.com/mjarkk/go-graphql" + "github.com/mjarkk/yarql" ) type Post struct { @@ -365,7 +368,7 @@ In your request add a form file with the field name: `form_file_field_name` ## Testing -There is a [pkg.go.dev mjarkk/go-graphql/tester](https://pkg.go.dev/github.com/mjarkk/go-graphql/tester) package available with handy tools for testing the schema +There is a [pkg.go.dev mjarkk/go-graphql/tester](https://pkg.go.dev/github.com/mjarkk/yarql/tester) package available with handy tools for testing the schema ## Performance diff --git a/assert/assert.go b/assert/assert.go index ec1ef36..69b0f23 100644 --- a/assert/assert.go +++ b/assert/assert.go @@ -14,7 +14,7 @@ import ( "unicode" "unicode/utf8" - "github.com/mjarkk/go-graphql/assert/difflib" + "github.com/mjarkk/yarql/assert/difflib" ) // TestingT is an interface wrapper around *testing.T diff --git a/banner.png b/banner.png new file mode 100644 index 0000000..70ab0c2 Binary files /dev/null and b/banner.png differ diff --git a/bytecode/bytecode.go b/bytecode/bytecode.go index 368981a..844a1c2 100644 --- a/bytecode/bytecode.go +++ b/bytecode/bytecode.go @@ -9,7 +9,7 @@ import ( "unicode/utf8" "unsafe" - "github.com/mjarkk/go-graphql/bytecode/cache" + "github.com/mjarkk/yarql/bytecode/cache" ) // ParserCtx has all the information needed to parse a query diff --git a/bytecode/bytecode_test.go b/bytecode/bytecode_test.go index 87e6916..4bad243 100644 --- a/bytecode/bytecode_test.go +++ b/bytecode/bytecode_test.go @@ -7,7 +7,7 @@ import ( "sync" "testing" - a "github.com/mjarkk/go-graphql/assert" + a "github.com/mjarkk/yarql/assert" ) func parseQuery(query string) ([]byte, []error) { diff --git a/bytecode/cache/bytecode_cache.go b/bytecode/cache/bytecode_cache.go index 8be9651..e8520f5 100644 --- a/bytecode/cache/bytecode_cache.go +++ b/bytecode/cache/bytecode_cache.go @@ -3,7 +3,7 @@ package cache import ( "bytes" - "github.com/mjarkk/go-graphql/helpers" + "github.com/mjarkk/yarql/helpers" ) // BytecodeCache contains the bytecode cache diff --git a/copy_schema.go b/copy_schema.go index acaad78..4235495 100644 --- a/copy_schema.go +++ b/copy_schema.go @@ -3,8 +3,8 @@ package graphql import ( "reflect" - "github.com/mjarkk/go-graphql/bytecode" - "github.com/mjarkk/go-graphql/helpers" + "github.com/mjarkk/yarql/bytecode" + "github.com/mjarkk/yarql/helpers" "github.com/valyala/fastjson" ) diff --git a/enums.go b/enums.go index 1fdb658..88f25de 100644 --- a/enums.go +++ b/enums.go @@ -6,7 +6,7 @@ import ( "reflect" "sort" - h "github.com/mjarkk/go-graphql/helpers" + h "github.com/mjarkk/yarql/helpers" ) type enum struct { diff --git a/enums_test.go b/enums_test.go index d1f30eb..da42c45 100644 --- a/enums_test.go +++ b/enums_test.go @@ -3,7 +3,7 @@ package graphql import ( "testing" - a "github.com/mjarkk/go-graphql/assert" + a "github.com/mjarkk/yarql/assert" ) func TestRegisterEnum(t *testing.T) { diff --git a/examples/fiber/go.mod b/examples/fiber/go.mod index 6dfce3d..9c116a9 100644 --- a/examples/fiber/go.mod +++ b/examples/fiber/go.mod @@ -1,10 +1,10 @@ -module github.com/mjarkk/go-graphql-fiber-example +module github.com/mjarkk/yarql-fiber-example go 1.16 require ( github.com/gofiber/fiber/v2 v2.11.0 - github.com/mjarkk/go-graphql v0.0.0-20210604095247-1a621d53c91c + github.com/mjarkk/yarql v0.0.0-20210604095247-1a621d53c91c ) -replace github.com/mjarkk/go-graphql => ../../ +replace github.com/mjarkk/yarql => ../../ diff --git a/examples/fiber/main.go b/examples/fiber/main.go index 315a98e..ccc133a 100644 --- a/examples/fiber/main.go +++ b/examples/fiber/main.go @@ -5,7 +5,7 @@ import ( "mime/multipart" "github.com/gofiber/fiber/v2" - "github.com/mjarkk/go-graphql" + graphql "github.com/mjarkk/yarql" ) func main() { diff --git a/examples/gin/go.mod b/examples/gin/go.mod index 12f36e2..7c1583d 100644 --- a/examples/gin/go.mod +++ b/examples/gin/go.mod @@ -1,4 +1,4 @@ -module github.com/mjarkk/go-graphql-gin-example +module github.com/mjarkk/yarql-gin-example go 1.16 @@ -16,7 +16,7 @@ require ( golang.org/x/sys v0.0.0-20210603125802-9665404d3644 // indirect golang.org/x/text v0.3.6 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - github.com/mjarkk/go-graphql v0.0.0-20210604095247-1a621d53c91c // indirect + github.com/mjarkk/yarql v0.0.0-20210604095247-1a621d53c91c // indirect ) -replace github.com/mjarkk/go-graphql => ../../ +replace github.com/mjarkk/yarql => ../../ diff --git a/examples/gin/main.go b/examples/gin/main.go index 4653829..6a39180 100644 --- a/examples/gin/main.go +++ b/examples/gin/main.go @@ -7,7 +7,7 @@ import ( "sync" "github.com/gin-gonic/gin" - "github.com/mjarkk/go-graphql" + graphql "github.com/mjarkk/yarql" ) func main() { diff --git a/examples/relay/backend/go.mod b/examples/relay/backend/go.mod index 791908e..5a70d9c 100644 --- a/examples/relay/backend/go.mod +++ b/examples/relay/backend/go.mod @@ -1,10 +1,10 @@ -module github.com/mjarkk/go-graphql-relay-example +module github.com/mjarkk/yarql-relay-example go 1.16 require ( github.com/gofiber/fiber/v2 v2.11.0 - github.com/mjarkk/go-graphql v0.0.0-20210604095247-1a621d53c91c + github.com/mjarkk/yarql v0.0.0-20210604095247-1a621d53c91c ) -replace github.com/mjarkk/go-graphql => ../../../ +replace github.com/mjarkk/yarql => ../../../ diff --git a/examples/relay/backend/main.go b/examples/relay/backend/main.go index 30fdd0c..0cfba4c 100644 --- a/examples/relay/backend/main.go +++ b/examples/relay/backend/main.go @@ -6,7 +6,7 @@ import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/cors" - "github.com/mjarkk/go-graphql" + graphql "github.com/mjarkk/yarql" ) func main() { diff --git a/examples/relay/backend/schema.go b/examples/relay/backend/schema.go index 44e1044..9ca8cdd 100644 --- a/examples/relay/backend/schema.go +++ b/examples/relay/backend/schema.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/mjarkk/go-graphql" + graphql "github.com/mjarkk/yarql" ) // QueryRoot defines the entry point for all graphql queries diff --git a/go.mod b/go.mod index 397e556..82ad7b0 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/mjarkk/go-graphql +module github.com/mjarkk/yarql go 1.16 diff --git a/grahql_types.go b/grahql_types.go index cec2de3..84e73b8 100644 --- a/grahql_types.go +++ b/grahql_types.go @@ -1,7 +1,7 @@ package graphql import ( - h "github.com/mjarkk/go-graphql/helpers" + h "github.com/mjarkk/yarql/helpers" ) // @@ -221,7 +221,7 @@ var ( Kind: typeKindScalar, Name: h.StrPtr("File"), Description: h.StrPtr("The File scalar type references to a multipart file, often used to upload files to the server. Expects a string with the form file field name"), - SpecifiedByURL: h.StrPtr("https://github.com/mjarkk/go-graphql#file-upload"), + SpecifiedByURL: h.StrPtr("https://github.com/mjarkk/yarql#file-upload"), } scalarTime = qlType{ Kind: typeKindScalar, diff --git a/implement_helpers.go b/implement_helpers.go index 7b72377..6ace83a 100644 --- a/implement_helpers.go +++ b/implement_helpers.go @@ -7,7 +7,7 @@ import ( "mime/multipart" "strings" - "github.com/mjarkk/go-graphql/helpers" + "github.com/mjarkk/yarql/helpers" "github.com/valyala/fastjson" ) diff --git a/implement_helpers_test.go b/implement_helpers_test.go index 5859223..ecbab30 100644 --- a/implement_helpers_test.go +++ b/implement_helpers_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - a "github.com/mjarkk/go-graphql/assert" + a "github.com/mjarkk/yarql/assert" ) func TestHandleRequestRequestInURL(t *testing.T) { diff --git a/inject_schema.go b/inject_schema.go index f61ea91..95e693e 100644 --- a/inject_schema.go +++ b/inject_schema.go @@ -5,7 +5,7 @@ import ( "reflect" "sort" - h "github.com/mjarkk/go-graphql/helpers" + h "github.com/mjarkk/yarql/helpers" ) func (s *Schema) injectQLTypes(ctx *parseCtx) { diff --git a/interfaces_test.go b/interfaces_test.go index c491dfc..72d0f81 100644 --- a/interfaces_test.go +++ b/interfaces_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - a "github.com/mjarkk/go-graphql/assert" + a "github.com/mjarkk/yarql/assert" ) type InterfaceSchema struct { diff --git a/parse_test.go b/parse_test.go index 5506b0b..6405ea8 100644 --- a/parse_test.go +++ b/parse_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - a "github.com/mjarkk/go-graphql/assert" + a "github.com/mjarkk/yarql/assert" ) func TestFormatGoNameToQL(t *testing.T) { diff --git a/readme_test.go b/readme_test.go index fbbf9b2..caa5833 100644 --- a/readme_test.go +++ b/readme_test.go @@ -4,7 +4,7 @@ import ( "log" "testing" - a "github.com/mjarkk/go-graphql/assert" + a "github.com/mjarkk/yarql/assert" ) // Making sure the code in the readme actually works :) diff --git a/resolver.go b/resolver.go index 54a5351..2ea8589 100644 --- a/resolver.go +++ b/resolver.go @@ -12,8 +12,8 @@ import ( "time" "unsafe" - "github.com/mjarkk/go-graphql/bytecode" - "github.com/mjarkk/go-graphql/helpers" + "github.com/mjarkk/yarql/bytecode" + "github.com/mjarkk/yarql/helpers" "github.com/valyala/fastjson" ) diff --git a/resolver_test.go b/resolver_test.go index ccfa6a2..29a33b4 100644 --- a/resolver_test.go +++ b/resolver_test.go @@ -12,8 +12,8 @@ import ( "testing" "time" - a "github.com/mjarkk/go-graphql/assert" - "github.com/mjarkk/go-graphql/helpers" + a "github.com/mjarkk/yarql/assert" + "github.com/mjarkk/yarql/helpers" ) func bytecodeParse(t *testing.T, s *Schema, query string, queries interface{}, methods interface{}, opts ...ResolveOptions) (string, []error) { diff --git a/tester/tester.go b/tester/tester.go index dd44968..9823c1c 100644 --- a/tester/tester.go +++ b/tester/tester.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "github.com/mjarkk/go-graphql" + graphql "github.com/mjarkk/yarql" ) // Type contains a subset of fields from the graphql __Type type diff --git a/tester/tester_test.go b/tester/tester_test.go index 71fd1d1..b63faeb 100644 --- a/tester/tester_test.go +++ b/tester/tester_test.go @@ -3,8 +3,8 @@ package tester import ( "testing" - "github.com/mjarkk/go-graphql" - "github.com/mjarkk/go-graphql/assert" + graphql "github.com/mjarkk/yarql" + "github.com/mjarkk/yarql/assert" ) type TesterQuerySchema struct { diff --git a/type_rename_test.go b/type_rename_test.go index f5aa59b..7d55aed 100644 --- a/type_rename_test.go +++ b/type_rename_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - a "github.com/mjarkk/go-graphql/assert" + a "github.com/mjarkk/yarql/assert" ) var _ = TypeRename(TestTypeRenameData{}, "Foo")