shorten enum and input-object type-names

This commit is contained in:
Ben Kraft
2021-04-01 12:40:54 -07:00
parent eae68e43c9
commit de038dc428
6 changed files with 57 additions and 44 deletions
+12 -12
View File
@@ -6,6 +6,13 @@ import (
"github.com/Khan/genqlient/graphql"
)
type Role string
const (
RoleStudent Role = "STUDENT"
RoleTeacher Role = "TEACHER"
)
type unexportedResponse struct {
User unexportedUser `json:"user"`
}
@@ -15,20 +22,13 @@ type unexportedUser struct {
}
type userQueryInput struct {
Email string `json:"email"`
Name string `json:"name"`
Id string `json:"id"`
Role userQueryInputRole `json:"role"`
Names []string `json:"names"`
Email string `json:"email"`
Name string `json:"name"`
Id string `json:"id"`
Role Role `json:"role"`
Names []string `json:"names"`
}
type userQueryInputRole string
const (
userQueryInputRoleStudent userQueryInputRole = "STUDENT"
userQueryInputRoleTeacher userQueryInputRole = "TEACHER"
)
func unexported(
client graphql.Client,
query userQueryInput,