Skip to content

Commit

Permalink
Load graphql schema from staging server on go generate (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
amitlicht authored Feb 14, 2023
1 parent 62aeb13 commit 547d40b
Show file tree
Hide file tree
Showing 9 changed files with 751 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*_gen.go linguist-generated=true
generated.go linguist-generated=true
go.mod linguist-generated=true
go.sum linguist-generated=true
go.sum linguist-generated=true
schema.graphql linguist-generated=true
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion src/cloudgraphql
Submodule cloudgraphql deleted from 4d044b
2 changes: 2 additions & 0 deletions src/go.mod

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

6 changes: 6 additions & 0 deletions src/go.sum

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

3 changes: 3 additions & 0 deletions src/mapper/pkg/cloudclient/generate.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package cloudclient

import _ "github.com/suessflorian/gqlfetch"

//go:generate sh -c "go run github.com/suessflorian/gqlfetch/gqlfetch --endpoint https://app.staging.otterize.com/api/graphql/v1beta > schema.graphql"
//go:generate go run github.com/Khan/genqlient ./genqlient.yaml
//go:generate go run github.com/golang/mock/[email protected] -destination=./mocks/mocks.go -package=cloudclientmocks -source=./cloud_client.go CloudClient
2 changes: 2 additions & 0 deletions src/mapper/pkg/cloudclient/generated.go

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

3 changes: 1 addition & 2 deletions src/mapper/pkg/cloudclient/genqlient.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# genqlient config; for full documentation see:
# https://github.com/Khan/genqlient/blob/main/docs/genqlient.yaml
schema:
- '../../../cloudgraphql/*.graphql'
- '../../../cloudgraphql/federation/*.graphql'
- ./schema.graphql
operations:
- genqlient.graphql
generated: ./generated.go
Expand Down
Loading

0 comments on commit 547d40b

Please sign in to comment.