redo type naming

This commit is contained in:
Ben Kraft
2021-03-19 18:40:58 -07:00
parent 58f4aff83b
commit fed38e4f55
20 changed files with 210 additions and 164 deletions
+8 -8
View File
@@ -9,20 +9,20 @@ import (
)
type QueryWithEnumsResponse struct {
User *User `json:"user"`
User *QueryWithEnumsUser `json:"user"`
}
type Role string
type QueryWithEnumsUser struct {
Roles []QueryWithEnumsUserRolesRole `json:"roles"`
}
type QueryWithEnumsUserRolesRole string
const (
StudentRole Role = "STUDENT"
TeacherRole Role = "TEACHER"
QueryWithEnumsUserRolesRoleStudent QueryWithEnumsUserRolesRole = "STUDENT"
QueryWithEnumsUserRolesRoleTeacher QueryWithEnumsUserRolesRole = "TEACHER"
)
type User struct {
Roles []Role `json:"roles"`
}
func QueryWithEnums(client *graphql.Client) (*QueryWithEnumsResponse, error) {
var retval QueryWithEnumsResponse
err := client.MakeRequest(context.Background(), `