Skip to content

Commit

Permalink
[gql] generated files and query definition
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammedamarnah committed May 8, 2024
1 parent f7a89eb commit a56fedd
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 25 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/ory/dockertest/v3 v3.10.0
github.com/sendgrid/rest v2.6.9+incompatible
github.com/sendgrid/sendgrid-go v3.14.0+incompatible
github.com/thanhpk/randstr v1.0.6
github.com/vektah/gqlparser/v2 v2.5.11
golang.org/x/crypto v0.21.0
)
Expand Down Expand Up @@ -63,7 +64,6 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/thanhpk/randstr v1.0.6 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
Expand Down
3 changes: 2 additions & 1 deletion graph/event.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
extend type Query {
allEvents(filter: AllEventsFilter!): [Event!]! @isAuthenticated
allEvents(filter: AllEventsFilter!): [Event!]!
myEvents(userId: Int!): [Event!]!
}

extend type Mutation {
Expand Down
158 changes: 139 additions & 19 deletions graph/generated.go

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

14 changes: 10 additions & 4 deletions graph/resolver/event.resolvers.go

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

12 changes: 12 additions & 0 deletions utils/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package utils

import "reflect"

func PointersOf(v interface{}) interface{} {
in := reflect.ValueOf(v)
out := reflect.MakeSlice(reflect.SliceOf(reflect.PointerTo(in.Type().Elem())), in.Len(), in.Len())
for i := 0; i < in.Len(); i++ {
out.Index(i).Set(in.Index(i).Addr())
}
return out.Interface()
}

0 comments on commit a56fedd

Please sign in to comment.