Skip to content
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
117 changes: 59 additions & 58 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,19 @@ What do you want to contribute?
Descriptions for each of these will eventually be provided below.

## General Guidelines
* Reading up on [CodeReviewComments](https://github.com/golang/go/wiki/CodeReviewComments) would be a great start.
* Submit a Github Pull Request to the appropriate branch and ideally discuss the changes with us in the [chat room](#chat-room).
* We will look at the patch, test it out, and give you feedback.
* Avoid doing minor whitespace changes, renaming, etc. along with merged content. These will be done by the maintainers from time to time but they can complicate merges and should be done separately.
* Take care to maintain the existing coding style.
* Always `golint` and `go fmt` your code.
* Add unit tests for any new or changed functionality, especially for public APIs.
* Run `go test` before submitting a PR.
* For git help see [progit](http://git-scm.com/book) which is an awesome (and free) book on git

- Reading up on [CodeReviewComments](https://github.com/golang/go/wiki/CodeReviewComments) would be a great start.
- Submit a Github Pull Request to the appropriate branch and ideally discuss the changes with us in the [chat room](#chat-room).
- We will look at the patch, test it out, and give you feedback.
- Avoid doing minor whitespace changes, renaming, etc. along with merged content. These will be done by the maintainers from time to time but they can complicate merges and should be done separately.
- Take care to maintain the existing coding style.
- Always `golint` and `go fmt` your code.
- Add unit tests for any new or changed functionality, especially for public APIs.
- Run `go test` before submitting a PR.
- For git help see [progit](http://git-scm.com/book) which is an awesome (and free) book on git

## Creating Pull Requests

Because `graphql` makes use of self-referencing import paths, you will want
to implement the local copy of your fork as a remote on your copy of the
original `graphql` repo. Katrina Owen has [an excellent post on this workflow](https://splice.com/blog/contributing-open-source-git-repositories-go/).
Expand All @@ -55,29 +56,30 @@ The basics are as follows:
2. `go get` the upstream repo and set it up as the `upstream` remote and your own repo as the `origin` remote:

```bash
$ go get github.com/tailor-inc/graphql
$ cd $GOPATH/src/github.com/tailor-inc/graphql
$ go get github.com/tailor-platform/graphql
$ cd $GOPATH/src/github.com/tailor-platform/graphql
$ git remote rename origin upstream
$ git remote add origin git@github.com/YOUR_GITHUB_NAME/graphql
```

All import paths should now work fine assuming that you've got the
proper branch checked out.


## Landing Pull Requests

(This is for committers only. If you are unsure whether you are a committer, you are not.)

1. Set the contributor's fork as an upstream on your checkout

```git remote add contrib1 https://github.com/contrib1/graphql```
`git remote add contrib1 https://github.com/contrib1/graphql`

2. Fetch the contributor's repo

```git fetch contrib1```
`git fetch contrib1`

3. Checkout a copy of the PR branch

```git checkout pr-1234 --track contrib1/branch-for-pr-1234```
`git checkout pr-1234 --track contrib1/branch-for-pr-1234`

4. Review the PR as normal

Expand All @@ -87,52 +89,51 @@ proper branch checked out.

By making a contribution to this project, I certify that:

* (a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license indicated
in the file; or
* (b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source license
and I have the right under that license to submit that work with
modifications, whether created in whole or in part by me, under the
same open source license (unless I am permitted to submit under a
different license), as indicated in the file; or
* (c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified it.

- (a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license indicated
in the file; or
- (b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source license
and I have the right under that license to submit that work with
modifications, whether created in whole or in part by me, under the
same open source license (unless I am permitted to submit under a
different license), as indicated in the file; or
- (c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified it.

## Code of Conduct

This Code of Conduct is adapted from [Rust's wonderful
CoC](http://www.rust-lang.org/conduct.html).

* We are committed to providing a friendly, safe and welcoming
environment for all, regardless of gender, sexual orientation,
disability, ethnicity, religion, or similar personal characteristic.
* Please avoid using overtly sexual nicknames or other nicknames that
might detract from a friendly, safe and welcoming environment for
all.
* Please be kind and courteous. There's no need to be mean or rude.
* Respect that people have differences of opinion and that every
design or implementation choice carries a trade-off and numerous
costs. There is seldom a right answer.
* Please keep unstructured critique to a minimum. If you have solid
ideas you want to experiment with, make a fork and see how it works.
* We will exclude you from interaction if you insult, demean or harass
anyone. That is not welcome behaviour. We interpret the term
"harassment" as including the definition in the [Citizen Code of
Conduct](http://citizencodeofconduct.org/); if you have any lack of
clarity about what might be included in that concept, please read
their definition. In particular, we don't tolerate behavior that
excludes people in socially marginalized groups.
* Private harassment is also unacceptable. No matter who you are, if
you feel you have been or are being harassed or made uncomfortable
by a community member, please contact one of the channel ops or any
of the TC members immediately with a capture (log, photo, email) of
the harassment if possible. Whether you're a regular contributor or
a newcomer, we care about making this community a safe place for you
and we've got your back.
* Likewise any spamming, trolling, flaming, baiting or other
attention-stealing behaviour is not welcome.
* Avoid the use of personal pronouns in code comments or
documentation. There is no need to address persons when explaining
code (e.g. "When the developer")
- We are committed to providing a friendly, safe and welcoming
environment for all, regardless of gender, sexual orientation,
disability, ethnicity, religion, or similar personal characteristic.
- Please avoid using overtly sexual nicknames or other nicknames that
might detract from a friendly, safe and welcoming environment for
all.
- Please be kind and courteous. There's no need to be mean or rude.
- Respect that people have differences of opinion and that every
design or implementation choice carries a trade-off and numerous
costs. There is seldom a right answer.
- Please keep unstructured critique to a minimum. If you have solid
ideas you want to experiment with, make a fork and see how it works.
- We will exclude you from interaction if you insult, demean or harass
anyone. That is not welcome behaviour. We interpret the term
"harassment" as including the definition in the [Citizen Code of
Conduct](http://citizencodeofconduct.org/); if you have any lack of
clarity about what might be included in that concept, please read
their definition. In particular, we don't tolerate behavior that
excludes people in socially marginalized groups.
- Private harassment is also unacceptable. No matter who you are, if
you feel you have been or are being harassed or made uncomfortable
by a community member, please contact one of the channel ops or any
of the TC members immediately with a capture (log, photo, email) of
the harassment if possible. Whether you're a regular contributor or
a newcomer, we care about making this community a safe place for you
and we've got your back.
- Likewise any spamming, trolling, flaming, baiting or other
attention-stealing behaviour is not welcome.
- Avoid the use of personal pronouns in code comments or
documentation. There is no need to address persons when explaining
code (e.g. "When the developer")
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# graphql [![Go package](https://github.com/tailor-inc/graphql/actions/workflows/ci.yml/badge.svg)](https://github.com/tailor-inc/graphql/actions/workflows/ci.yml) [![Go Reference](https://pkg.go.dev/badge/github.com/tailor-inc/graphql.svg)](https://pkg.go.dev/github.com/tailor-inc/graphql)
# graphql [![Go package](https://github.com/tailor-platform/graphql/actions/workflows/ci.yml/badge.svg)](https://github.com/tailor-platform/graphql/actions/workflows/ci.yml) [![Go Reference](https://pkg.go.dev/badge/github.com/tailor-platform/graphql.svg)](https://pkg.go.dev/github.com/tailor-platform/graphql)

An implementation of GraphQL in Go. Follows the official reference implementation [`graphql-js`](https://github.com/graphql/graphql-js).

Supports: queries, mutations & subscriptions.

### Documentation

godoc: https://pkg.go.dev/github.com/tailor-inc/graphql
godoc: https://pkg.go.dev/github.com/tailor-platform/graphql

### Getting Started

To install the library, run:

```bash
go get github.com/tailor-inc/graphql
go get github.com/tailor-platform/graphql
```

The following is a simple example which defines a schema with a single `hello` string-type field and a `Resolve` method which returns the string `world`. A GraphQL query is performed against this schema with the resulting output printed in JSON format.
Expand All @@ -25,7 +26,7 @@ import (
"fmt"
"log"

"github.com/tailor-inc/graphql"
"github.com/tailor-platform/graphql"
)

func main() {
Expand Down Expand Up @@ -60,16 +61,18 @@ func main() {
fmt.Printf("%s \n", rJSON) // {"data":{"hello":"world"}}
}
```
For more complex examples, refer to the [examples/](https://github.com/tailor-inc/graphql/tree/master/examples/) directory and [graphql_test.go](https://github.com/tailor-inc/graphql/blob/master/graphql_test.go).

For more complex examples, refer to the [examples/](https://github.com/tailor-platform/graphql/tree/master/examples/) directory and [graphql_test.go](https://github.com/tailor-platform/graphql/blob/master/graphql_test.go).

### Third Party Libraries
| Name | Author | Description |
|:-------------:|:-------------:|:------------:|
| [graphql-go-handler](https://github.com/tailor-inc/graphql-go-handler) | [Hafiz Ismail](https://github.com/sogko) | Middleware to handle GraphQL queries through HTTP requests. |
| [graphql-relay-go](https://github.com/tailor-inc/graphql-relay-go) | [Hafiz Ismail](https://github.com/sogko) | Lib to construct a graphql-go server supporting react-relay. |
| [golang-relay-starter-kit](https://github.com/sogko/golang-relay-starter-kit) | [Hafiz Ismail](https://github.com/sogko) | Barebones starting point for a Relay application with Golang GraphQL server. |
| [dataloader](https://github.com/nicksrandall/dataloader) | [Nick Randall](https://github.com/nicksrandall) | [DataLoader](https://github.com/facebook/dataloader) implementation in Go. |

| Name | Author | Description |
| :---------------------------------------------------------------------------: | :---------------------------------------------: | :--------------------------------------------------------------------------: |
| [graphql-go-handler](https://github.com/tailor-platform/graphql-go-handler) | [Hafiz Ismail](https://github.com/sogko) | Middleware to handle GraphQL queries through HTTP requests. |
| [graphql-relay-go](https://github.com/tailor-platform/graphql-relay-go) | [Hafiz Ismail](https://github.com/sogko) | Lib to construct a graphql-go server supporting react-relay. |
| [golang-relay-starter-kit](https://github.com/sogko/golang-relay-starter-kit) | [Hafiz Ismail](https://github.com/sogko) | Barebones starting point for a Relay application with Golang GraphQL server. |
| [dataloader](https://github.com/nicksrandall/dataloader) | [Nick Randall](https://github.com/nicksrandall) | [DataLoader](https://github.com/facebook/dataloader) implementation in Go. |

### Blog Posts
- [Golang + GraphQL + Relay](https://wehavefaces.net/learn-golang-graphql-relay-1-e59ea174a902)

- [Golang + GraphQL + Relay](https://wehavefaces.net/learn-golang-graphql-relay-1-e59ea174a902)
8 changes: 4 additions & 4 deletions abstract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"reflect"
"testing"

"github.com/tailor-inc/graphql"
"github.com/tailor-inc/graphql/gqlerrors"
"github.com/tailor-inc/graphql/language/location"
"github.com/tailor-inc/graphql/testutil"
"github.com/tailor-platform/graphql"
"github.com/tailor-platform/graphql/gqlerrors"
"github.com/tailor-platform/graphql/language/location"
"github.com/tailor-platform/graphql/testutil"
)

type testDog struct {
Expand Down
2 changes: 1 addition & 1 deletion benchutil/list_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package benchutil
import (
"fmt"

"github.com/tailor-inc/graphql"
"github.com/tailor-platform/graphql"
)

type color struct {
Expand Down
2 changes: 1 addition & 1 deletion benchutil/wide_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package benchutil
import (
"fmt"

"github.com/tailor-inc/graphql"
"github.com/tailor-platform/graphql"
)

func WideSchemaWithXFieldsAndYItems(x int, y int) graphql.Schema {
Expand Down
2 changes: 1 addition & 1 deletion definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"
"regexp"

"github.com/tailor-inc/graphql/language/ast"
"github.com/tailor-platform/graphql/language/ast"
)

// Type interface for all of the possible kinds of GraphQL types
Expand Down
4 changes: 2 additions & 2 deletions definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"reflect"
"testing"

"github.com/tailor-inc/graphql"
"github.com/tailor-inc/graphql/testutil"
"github.com/tailor-platform/graphql"
"github.com/tailor-platform/graphql/testutil"
)

var blogImage = graphql.NewObject(graphql.ObjectConfig{
Expand Down
6 changes: 3 additions & 3 deletions directives_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"errors"
"testing"

"github.com/tailor-inc/graphql"
"github.com/tailor-inc/graphql/gqlerrors"
"github.com/tailor-inc/graphql/testutil"
"github.com/tailor-platform/graphql"
"github.com/tailor-platform/graphql/gqlerrors"
"github.com/tailor-platform/graphql/testutil"
)

var directivesTestSchema, _ = graphql.NewSchema(graphql.SchemaConfig{
Expand Down
8 changes: 4 additions & 4 deletions enum_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"reflect"
"testing"

"github.com/tailor-inc/graphql"
"github.com/tailor-inc/graphql/gqlerrors"
"github.com/tailor-inc/graphql/language/location"
"github.com/tailor-inc/graphql/testutil"
"github.com/tailor-platform/graphql"
"github.com/tailor-platform/graphql/gqlerrors"
"github.com/tailor-platform/graphql/language/location"
"github.com/tailor-platform/graphql/testutil"
)

var enumTypeTestColorType = graphql.NewEnum(graphql.EnumConfig{
Expand Down
2 changes: 1 addition & 1 deletion examples/concurrent-resolvers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

"github.com/tailor-inc/graphql"
"github.com/tailor-platform/graphql"
)

type Foo struct {
Expand Down
2 changes: 1 addition & 1 deletion examples/context/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"log"
"net/http"

"github.com/tailor-inc/graphql"
"github.com/tailor-platform/graphql"
)

var Schema graphql.Schema
Expand Down
2 changes: 1 addition & 1 deletion examples/crud/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"time"

"github.com/tailor-inc/graphql"
"github.com/tailor-platform/graphql"
)

// Product contains information about one product
Expand Down
4 changes: 2 additions & 2 deletions examples/custom-scalar-type/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"log"

"github.com/tailor-inc/graphql"
"github.com/tailor-inc/graphql/language/ast"
"github.com/tailor-platform/graphql"
"github.com/tailor-platform/graphql/language/ast"
)

type CustomID struct {
Expand Down
4 changes: 2 additions & 2 deletions examples/federation/accounts/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"fmt"
"github.com/gorilla/mux"
"github.com/tailor-inc/graphql"
"github.com/tailor-inc/graphql/playground"
"github.com/tailor-platform/graphql"
"github.com/tailor-platform/graphql/playground"
"log"
"net/http"
)
Expand Down
2 changes: 1 addition & 1 deletion examples/federation/gateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"context"
"fmt"
http2 "github.com/tailor-inc/graphql/federation/gateway/http"
http2 "github.com/tailor-platform/graphql/federation/gateway/http"
"net/http"
"strings"
"time"
Expand Down
6 changes: 3 additions & 3 deletions examples/federation/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/tailor-inc/graphql/federation
module github.com/tailor-platform/graphql/federation

go 1.24.0

Expand All @@ -8,12 +8,12 @@ require (
github.com/gobwas/ws v1.3.0
github.com/gorilla/mux v1.8.0
github.com/jensneuse/abstractlogger v0.0.4
github.com/tailor-inc/graphql v0.0.1
github.com/tailor-platform/graphql v0.0.1
github.com/wundergraph/graphql-go-tools v1.67.0
go.uber.org/zap v1.26.0
)

replace github.com/tailor-inc/graphql => ../../
replace github.com/tailor-platform/graphql => ../../

require (
github.com/Masterminds/goutils v1.1.1 // indirect
Expand Down
6 changes: 3 additions & 3 deletions examples/federation/products/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"encoding/json"
"fmt"
"github.com/gorilla/mux"
"github.com/tailor-inc/graphql"
"github.com/tailor-inc/graphql/federation/products/models"
"github.com/tailor-inc/graphql/playground"
"github.com/tailor-platform/graphql"
"github.com/tailor-platform/graphql/federation/products/models"
"github.com/tailor-platform/graphql/playground"
"log"
"math/rand"
"net/http"
Expand Down
Loading