From 42948153981d2fe84c715b20b396966dd74d5c09 Mon Sep 17 00:00:00 2001 From: vvakame Date: Fri, 6 Jul 2018 13:08:41 +0900 Subject: [PATCH] move to .gqlgen.yml --- example/chat/.gqlgen.yml | 3 +++ example/chat/resolvers.go | 2 +- example/chat/types.json | 3 --- example/dataloader/.gqlgen.yml | 5 +++++ example/dataloader/resolvers.go | 2 +- example/dataloader/types.json | 4 ---- example/scalars/.gqlgen.yml | 13 +++++++++++++ example/scalars/resolvers.go | 2 +- example/scalars/types.json | 8 -------- example/selection/selection.go | 2 +- example/starwars/.gqlgen.yml | 15 +++++++++++++++ example/starwars/resolvers.go | 2 +- example/starwars/types.json | 9 --------- test/.gqlgen.yml | 9 +++++++-- test/resolvers_test.go | 2 +- 15 files changed, 49 insertions(+), 32 deletions(-) create mode 100644 example/chat/.gqlgen.yml delete mode 100644 example/chat/types.json create mode 100644 example/dataloader/.gqlgen.yml delete mode 100644 example/dataloader/types.json create mode 100644 example/scalars/.gqlgen.yml delete mode 100644 example/scalars/types.json create mode 100644 example/starwars/.gqlgen.yml delete mode 100644 example/starwars/types.json diff --git a/example/chat/.gqlgen.yml b/example/chat/.gqlgen.yml new file mode 100644 index 00000000000..d91f2944d15 --- /dev/null +++ b/example/chat/.gqlgen.yml @@ -0,0 +1,3 @@ +models: + Chatroom: + model: github.com/vektah/gqlgen/example/chat.Chatroom diff --git a/example/chat/resolvers.go b/example/chat/resolvers.go index 979835cc25d..6bbb0a60dc6 100644 --- a/example/chat/resolvers.go +++ b/example/chat/resolvers.go @@ -1,4 +1,4 @@ -//go:generate gorunpkg github.com/vektah/gqlgen -typemap types.json -out generated.go +//go:generate gorunpkg github.com/vektah/gqlgen package chat diff --git a/example/chat/types.json b/example/chat/types.json deleted file mode 100644 index 7d13de6dfea..00000000000 --- a/example/chat/types.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Chatroom": "github.com/vektah/gqlgen/example/chat.Chatroom" -} diff --git a/example/dataloader/.gqlgen.yml b/example/dataloader/.gqlgen.yml new file mode 100644 index 00000000000..d71f8dfe2c7 --- /dev/null +++ b/example/dataloader/.gqlgen.yml @@ -0,0 +1,5 @@ +models: + Order: + model: github.com/vektah/gqlgen/example/dataloader.Order + Customer: + model: github.com/vektah/gqlgen/example/dataloader.Customer diff --git a/example/dataloader/resolvers.go b/example/dataloader/resolvers.go index f2ab7e5d363..2bd93c95ba5 100644 --- a/example/dataloader/resolvers.go +++ b/example/dataloader/resolvers.go @@ -1,4 +1,4 @@ -//go:generate gorunpkg github.com/vektah/gqlgen -out generated.go -typemap types.json +//go:generate gorunpkg github.com/vektah/gqlgen package dataloader diff --git a/example/dataloader/types.json b/example/dataloader/types.json deleted file mode 100644 index 3de131fd4a2..00000000000 --- a/example/dataloader/types.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Order": "github.com/vektah/gqlgen/example/dataloader.Order", - "Customer": "github.com/vektah/gqlgen/example/dataloader.Customer" -} diff --git a/example/scalars/.gqlgen.yml b/example/scalars/.gqlgen.yml new file mode 100644 index 00000000000..366f4f2f50b --- /dev/null +++ b/example/scalars/.gqlgen.yml @@ -0,0 +1,13 @@ +models: + User: + model: github.com/vektah/gqlgen/example/scalars.User + Timestamp: + model: github.com/vektah/gqlgen/example/scalars.Timestamp + SearchArgs: + model: github.com/vektah/gqlgen/example/scalars.SearchArgs + Point: + model: github.com/vektah/gqlgen/example/scalars.Point + ID: + model: github.com/vektah/gqlgen/example/scalars.ID + Tier: + model: github.com/vektah/gqlgen/example/scalars.Tier diff --git a/example/scalars/resolvers.go b/example/scalars/resolvers.go index 15b8724f765..bf5cc020982 100644 --- a/example/scalars/resolvers.go +++ b/example/scalars/resolvers.go @@ -1,4 +1,4 @@ -//go:generate gorunpkg github.com/vektah/gqlgen -typemap types.json -out generated.go +//go:generate gorunpkg github.com/vektah/gqlgen package scalars diff --git a/example/scalars/types.json b/example/scalars/types.json deleted file mode 100644 index 26ac8440b0f..00000000000 --- a/example/scalars/types.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "User": "github.com/vektah/gqlgen/example/scalars.User", - "Timestamp": "github.com/vektah/gqlgen/example/scalars.Timestamp", - "SearchArgs": "github.com/vektah/gqlgen/example/scalars.SearchArgs", - "Point": "github.com/vektah/gqlgen/example/scalars.Point", - "ID": "github.com/vektah/gqlgen/example/scalars.ID", - "Tier": "github.com/vektah/gqlgen/example/scalars.Tier" -} diff --git a/example/selection/selection.go b/example/selection/selection.go index 0da2a39e301..9ccc8590d0f 100644 --- a/example/selection/selection.go +++ b/example/selection/selection.go @@ -1,4 +1,4 @@ -//go:generate gorunpkg github.com/vektah/gqlgen -out generated.go +//go:generate gorunpkg github.com/vektah/gqlgen package selection diff --git a/example/starwars/.gqlgen.yml b/example/starwars/.gqlgen.yml new file mode 100644 index 00000000000..01193161cd8 --- /dev/null +++ b/example/starwars/.gqlgen.yml @@ -0,0 +1,15 @@ +models: + Droid: + model: github.com/vektah/gqlgen/example/starwars.Droid + FriendsConnection: + model: github.com/vektah/gqlgen/example/starwars.FriendsConnection + FriendsEdge: + model: github.com/vektah/gqlgen/example/starwars.FriendsEdge + Human: + model: github.com/vektah/gqlgen/example/starwars.Human + Review: + model: github.com/vektah/gqlgen/example/starwars.Review + ReviewInput: + model: github.com/vektah/gqlgen/example/starwars.Review + Starship: + model: github.com/vektah/gqlgen/example/starwars.Starship diff --git a/example/starwars/resolvers.go b/example/starwars/resolvers.go index fe18d7598bb..038ce15ef92 100644 --- a/example/starwars/resolvers.go +++ b/example/starwars/resolvers.go @@ -1,4 +1,4 @@ -//go:generate gorunpkg github.com/vektah/gqlgen -typemap types.json -out generated.go +//go:generate gorunpkg github.com/vektah/gqlgen package starwars diff --git a/example/starwars/types.json b/example/starwars/types.json deleted file mode 100644 index ce1985c81be..00000000000 --- a/example/starwars/types.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Droid": "github.com/vektah/gqlgen/example/starwars.Droid", - "FriendsConnection": "github.com/vektah/gqlgen/example/starwars.FriendsConnection", - "FriendsEdge": "github.com/vektah/gqlgen/example/starwars.FriendsEdge", - "Human": "github.com/vektah/gqlgen/example/starwars.Human", - "Review": "github.com/vektah/gqlgen/example/starwars.Review", - "ReviewInput": "github.com/vektah/gqlgen/example/starwars.Review", - "Starship": "github.com/vektah/gqlgen/example/starwars.Starship" -} diff --git a/test/.gqlgen.yml b/test/.gqlgen.yml index 85c404fc822..421c38713a9 100644 --- a/test/.gqlgen.yml +++ b/test/.gqlgen.yml @@ -1,6 +1,11 @@ schema: schema.graphql -output: generated.go -modeloutput: models/generated.go + +exec: + filename: generated.go + # package: +model: + filename: models/generated.go + # package: models: Element: diff --git a/test/resolvers_test.go b/test/resolvers_test.go index ddb7fd3562d..805e68e76b5 100644 --- a/test/resolvers_test.go +++ b/test/resolvers_test.go @@ -1,4 +1,4 @@ -//go:generate gorunpkg github.com/vektah/gqlgen -models models/generated.go +//go:generate gorunpkg github.com/vektah/gqlgen package test