-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b864d9
commit 7c6f6f0
Showing
14 changed files
with
744 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Example Dockerfile from apollo-server | ||
# | ||
FROM golang:1.19 | ||
FROM golang:1.20 | ||
|
||
WORKDIR /go/src/server | ||
COPY . . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"description": "go generate based graphql server library", | ||
"stargazerCount": 9485, | ||
"lastRelease": "2024-02-15T16:18:26Z" | ||
} | ||
"stargazerCount": 9515, | ||
"lastRelease": "2024-03-11T23:13:16Z" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
module subgraph | ||
|
||
go 1.19 | ||
go 1.20 | ||
|
||
require ( | ||
github.com/99designs/gqlgen v0.17.41 | ||
github.com/vektah/gqlparser/v2 v2.5.10 | ||
github.com/99designs/gqlgen v0.17.45 | ||
github.com/vektah/gqlparser/v2 v2.5.11 | ||
) | ||
|
||
require ( | ||
github.com/agnivade/levenshtein v1.1.1 // indirect | ||
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect | ||
github.com/google/uuid v1.3.0 // indirect | ||
github.com/gorilla/websocket v1.5.0 // indirect | ||
github.com/hashicorp/golang-lru/v2 v2.0.3 // indirect | ||
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect | ||
github.com/google/uuid v1.6.0 // indirect | ||
github.com/gorilla/websocket v1.5.1 // indirect | ||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect | ||
github.com/mitchellh/mapstructure v1.5.0 // indirect | ||
github.com/russross/blackfriday/v2 v2.1.0 // indirect | ||
github.com/sosodev/duration v1.1.0 // indirect | ||
github.com/urfave/cli/v2 v2.25.5 // indirect | ||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect | ||
golang.org/x/mod v0.10.0 // indirect | ||
golang.org/x/sys v0.13.0 // indirect | ||
golang.org/x/text v0.13.0 // indirect | ||
golang.org/x/tools v0.9.3 // indirect | ||
github.com/sosodev/duration v1.2.0 // indirect | ||
github.com/urfave/cli/v2 v2.27.1 // indirect | ||
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e // indirect | ||
golang.org/x/mod v0.16.0 // indirect | ||
golang.org/x/net v0.22.0 // indirect | ||
golang.org/x/text v0.14.0 // indirect | ||
golang.org/x/tools v0.19.0 // indirect | ||
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect | ||
google.golang.org/protobuf v1.30.0 // indirect | ||
google.golang.org/protobuf v1.33.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
implementations/gqlgen/graph/generated/federation.requires.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package generated | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
"fmt" | ||
"subgraph/graph/model" | ||
) | ||
|
||
// PopulateUserRequires is the requires populator for the User entity. | ||
func (ec *executionContext) PopulateUserRequires(ctx context.Context, entity *model.User, reps map[string]interface{}) error { | ||
if reps["totalProductsCreated"] != nil && reps["yearsOfEmployment"] != nil { | ||
totalProducts, err := reps["totalProductsCreated"].(json.Number).Int64() | ||
if err != nil { | ||
return fmt.Errorf("cannot convert totalProductsCreated to int64") | ||
} | ||
yearsOfEmployment, err := reps["yearsOfEmployment"].(json.Number).Int64() | ||
if err != nil { | ||
return fmt.Errorf("cannot convert yearsOfEmployment to int64") | ||
} | ||
averageProducts := int(totalProducts / yearsOfEmployment) | ||
entity.AverageProductsCreatedPerYear = &averageProducts | ||
|
||
} | ||
return nil | ||
} |
Oops, something went wrong.